[Bug] v0.8.0 stopped IPython kernel remains permanently cached after unexpected exit #1659
Replies: 2 comments 1 reply
|
I hit this exact bug independently on v0.8.0 (Linux) and can confirm it still reproduces on current While diagnosing a real session, I traced it back one layer further than the So I built on the lazy-guard direction from #1658 with a small superset that recovers eagerly too:
Validation:
Branch (single commit, only the fix + a changelog fragment): https://github.com/coleleavitt/prime-agent/tree/fix/ipython-kernel-reprovision Happy to open a PR or adjust the shape to match your preferred direction (eager callback vs. lazy-only) if a maintainer wants this picked up. |
|
Additional independent validation on current
Validation: 42 focused and adjacent kernel tests passed, and The one-time replay is the material difference from the lazy-only and eager-callback branches already discussed here. Because a cell may have produced partial side effects before the kernel exited, replay may be unsafe. Before I publish a branch, would maintainers prefer the existing no-replay recovery semantics, or is a bounded automatic replay desired for this tool path? |
Uh oh!
There was an error while loading. Please reload this page.
Prime Agent 0.8.0 still leaves a session permanently unable to execute Python after an unexpected IPython kernel exit.
Reproduction
import os; os._exit(23)to simulate an unexpected kernel exit.1 + 1in a second explicit IPython call.Without the patch, every call from step 3 onward returns
Kernel has been shut down. The agent session remains responsive, so autonomous or heartbeat prompts can keep consuming turns without a working tool.Cause
KernelManagercorrectly becomes non-running after the unexpected exit, butIpythonKernelProvisionerretains both its resolvedmanagerPromiseandstartedManager. Laterensure()calls return the same stopped manager instead of following the existing full provisioning path.This is the unrecoverable lifecycle previously discussed in #764. The v0.8.0 cold-boot and parent-watchdog fixes address different failure modes; current
mainstill caches the stopped manager.Minimal fix tested locally
Before
ensure()reuses its memo, discard a resolvedstartedManagerwhoseisRunningis false. The next call then reuses existingstartKernel(), including snapshot restore and runtime bootstrap. Do not replay the failed cell.Patch commit: Atroci@9c09cc8
Automatically closed PR: #1658
Validation:
npm run check: passedos._exit(23), second IPython call returned2If this direction is accepted, I can update the patch to match maintainer feedback.
All reactions