Repository navigation
Conversation
Serialize runtime replacement and disposal so outgoing sessions remain valid until their successors are ready.
Prepare forked and restored runtimes without mutating the live session before replacement succeeds.
Activate routed harness sessions atomically and hand accepted plan continuations to the selected runtime.
- The replayed runtime carried the task profile router, harness descriptors, and evolved-notes loading, none of which exist on main, so the module could not resolve its imports - Removing profile routing leaves the plan continuation path, exclusive operation ownership, and prompt preparation queue, which is everything plan mode actually needs
Issacboy123
approved these changes
Aug 17, 2026
Issacboy123
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Plan continuations now run through the runtime's normal ownership and replacement path, including forks and routed sessions. That gives them the same admission guarantees as other prompts. No issues discovered during review.
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.
Summary
Gives
AgentSessionRuntimethe ownership model plan continuations need: exclusive runtime operations, a serialized prompt preparation queue, and a plan continuation entry point that cannot interleave with session replacement.Replaces #65, which imported five modules that exist only on the task profile stack.
Reasoning
An accepted plan is submitted as a trusted prompt, and it must not race a
/clear,/resume, or/forkthat is already underway.Serializing prompt preparation behind a single exclusive owner makes that race impossible rather than unlikely, and lets disposal wait for the in-flight operation to settle instead of tearing down under it.
Profile routing is deliberately absent.
The original PR interleaved harness resolution with plan activation inside the same methods, which is what coupled the two features.
Keeping the runtime plan-only here is what lets plan mode merge independently of the task profile stack.
Changes
promptPlanContinuation, which takes exclusive ownership and validates the continuation is still pendingSessionImportFileNotFoundErrorand target validation for import and resumeTesting
npx vitest --run test/suite/agent-session-runtime.test.ts test/suite/agent-session-plan-mode.test.tstsgo --noEmitreports zero errorsbiome check .clean