You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(colab): ask for a restart only when an upgraded module is already loaded #217
The 2026.11.12.1 Colab bootstrap (setup_colab._ensure_jax_floor, #216) raises ColabRestartRequired whenever jax or numpy is already imported after upgrading. Importing autonerves.setup_colab itself loads numpy (not jax), so on live Colab (manifest 2026-11-12: jax 0.11.1, numpy 2.4.6) it upgrades only jax and then always demands a restart. Heart's Colab gate (verify_install check F) fails with setup cell rc=1 (PyAutoLabs/PyAutoHeart release-integrate run 43238247828), so Heart reads RED until a fixed Nerves is released.
Plan
Nerves: upgrade only what is below the floor (jax+jaxlib together; numpy only if <2.2; the matching CUDA plugin when jax is upgraded on a GPU runtime). Raise ColabRestartRequired only if an upgraded module (jax/jaxlib, or numpy) is already in sys.modules, and name what was upgraded. On Colab jax isn't loaded before the setup cell, so most users get no restart.
Heart check F: if the setup cell raises ColabRestartRequired, re-run it once in a fresh process (what a user does after restarting). Fail only if that second run fails.
Tests for both. Check F clears at the next release, because it audits the released bootstrap.
Nerves: only what is below the floor is upgraded, and a restart is requested only if an upgraded module is already loaded. A live-Colab simulation (jax 0.11.1, numpy 2.4.6, real pip) upgraded jax with no restart and ran jax 0.12.0.1 in the same process.
Heart check F re-runs the cell once after a restart request, as a user would.
Check F (which audits the released bootstrap) reads red until that release.
Activity
Jammy2211 commentedon Nov 12, 2026
Shipped to main (#218 and PyAutoLabs/PyAutoHeart#337 merged); it reaches Colab users with the next release.