Repository navigation
fix(agent-hooks): a proven agent exit survives restarts, late hooks and same-second attaches - #29483
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… hooks, and same-second attaches - Persist proven exits with the hook store's status file and restore them on hydrate (#29359). - Clear a retained exit only on evidence of a successor agent: a different process identity or a new turn/session, never a PID-less late hook from the ended session (#29356). - Forget a pane's earlier exits when a remote worker attaches, so the attach fence no longer rounds up and drops exits in the creation second (#29293). Co-Authored-By: Claude <[email protected]>
…t; older spool replays keep it Co-Authored-By: Claude <[email protected]>
…same-second spool stamps count as successors Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
…op pre-exit spool replays Co-Authored-By: Claude <[email protected]>
nwparker
force-pushed
the
nwparker/remote-worker-liveness-followups
branch
from
October 16, 2026 06:40
0a516e0 to
8c26f3a
Compare
1 task done
This was referenced Oct 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
#29276 taught the remote host to say "this worker's agent has exited" once it can prove it. This PR closes three gaps where that proof was lost, so the host went back to calling a dead worker "live". It never makes the host call a running agent "exited".
What Changed
Before
live.Stop), erased the proof.After
exited. When a real successor agent starts in the pane, the proof is still cleared and the worker reads by its terminal's state again.Mechanism (all on the execution host, in the hook-server store)
agentExitslist and restored on start. Each entry holds the time, every pane key the pane went by, and the ended agent's type and process. Older files simply lack the list.claimsPaneAfterExit):isNewTurnEvent);forgetHookAgentExitruntime binding). That lets the read cut-off use the attachment's own creation time instead of rounding up.Why
liveorunverifiable, never towardexited. A case the host can't prove staysliveorunverifiable.Linked Issue
Fixes #29359
Fixes #29356
Fixes #29293
Visual Proof
N/A. Host-side liveness verdict with no UI.
Testing
server-agent-presence.test.tsgains cases for: restart persistence; a late hook without an ID; a provider-specific new turn; another provider without a new-turn event; a replacement after a late unidentified hook; an older spooled start (including one carrying an old process ID); a same-second spooled successor; a late terminal repaint from another provider; and forgetting at attach.federation-agent-death-liveness.test.tschecks that attaching forgets earlier exits and that the read cut-off is no longer rounded up.The new cases that cover the three issues fail on the fix(orchestration): remote worker liveness reports exited when the host proves the agent gone #29276 base.
I also re-ran the hook spool, last-status hydrate and persist-throttle suites.
pnpm tc:nodeandcheck:code-quality:changedpass.Codex review (gpt-6.1-sol, high) took five rounds. Every finding was fixed, and the final round found nothing actionable.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
This builds on #29276, which has merged; the branch is rebased onto main.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)