Note
🤖 Claude Opus 5.5 responding on behalf of Aly Raffauf
Closing this. The full gate fails 19 of 1,019 daemon end-to-end tests on this branch. The new local-job tests pass, and four of the failing tests that I re-ran on the parent commit pass there. Most of the failures come from the design rather than separate bugs:
- Local commands now stop when the daemon stops. On
main, a detached kernel and its jobs survive a daemon restart, and a job that ends afterwards still wakes the session. This PR deletes or rewrites those tests in kernel_detach_test.py.
- Helper-owned jobs no longer pin their kernel. That breaks idle reaping, state expiry, and cache warming (
idle_reap_test, state_expiry_test, warm_test). To compensate, status, warming, and observation code calls the helper and can block for up to 5 s.
- Completion wakes have two owners: the kernel's job hooks and a one-second helper sweep, coordinated by a hold/release/settle protocol.
- Restart becomes asynchronous and parks incoming work. Restart requests time out after 20 s, and the daemon logs
kernel_cleanup_failed.
The gap this fills is narrow. On main, a live job already pins its kernel, delays bundle upgrades, and survives a daemon restart. It doesn't survive the kernel dying on its own (a crash, an out-of-memory kill, or the wedge watchdog). Covering that needs a job owner outside the kernel, but one with the kernel's detached, reattachable lifetime, so jobs still survive daemon restarts. That needs a design before code.
The one independent fix here moves to its own PR: report a job stop that wasn't confirmed instead of answering ok.