Repository navigation
feat(pair): keep the executor in step with its lead - #632
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This branch was successfully deployed
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.
Problem
A pair executor is an ordinary thread, so nothing ties its lifecycle to its lead. Archive or delete a lead and its executor is left behind. Rewind a lead while its executor is mid-turn and the executor keeps editing the worktree they share, on top of the restored files. And the idle-session reaper stops an executor after thirty minutes even while its lead is mid-turn and about to brief it again.
What this adds
PairLifecycleReactor, a sidecar over domain events that dispatches only existing commands. Archiving, settling, or deleting a lead does the same to its executor, including an executor that was archived when the pair was turned off. An executor's own lifecycle never echoes back, because archiving it is how a user turns a pair off, and unarchiving a lead does not turn a pair back on. Command ids are derived from the causing event, so a replayed event is absorbed by the receipt store. It reads no settings: following a lead is cleanup and keeps working after delegation is turned off.thread.checkpoint-revert-requestedis seen. The executor may still write for a moment before the interrupt lands.ProviderSessionReaperskips a pair executor while its lead's session isstartingorrunning. A fan-out child is reaped as before.Not covered
Verification
Run independently by the lead in the executor's worktree:
pairLifecycle.logic,PairLifecycleReactor,OrchestrationReactor,serverRuntimeStartup,ProviderSessionReaper,DelegationFollowThroughReactor,ThreadSettlementReactor, and the pair toolkit: 115 tests passed. After the protocol rewrite,RuntimeInstructionsand the pair handlers: 45 passed.vp run -F t3 typecheck: exit 0.vp run knip:check: clean.decider.ts,projector.ts, migrations,packages/contracts,ws.ts,CheckpointReactor.ts.Part of #622.
Contract, tests, protocol text, docs, and review by Claude Fable 5.1 in Claude Code; implementation by Gemini 3.8 Flash (High) in Antigravity, as a Pylon delegated child.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.