Repository navigation
Route factory session Steps across configured Plan usage routes - #2200
Merged
Merged
Conversation
Before each session Step, a Command whose Harness comes from the User config's harness.routes starts on the first route machine-local Plan usage says can take it, refreshing stale Codex and Muse snapshots with their non-billed reads. A session that stops on structured Plan-usage evidence starts its Step again as a fresh session on the next untried route, after discarding uncommitted changes (keeping commits and re-merging a pinned conflict merge); an implement session that made commits continues with the existing Continuation prompt. Security reviews and Security runs walk security.routes, else harness.routes, after security.harness. Explicit Harness flags, Step Harnesses, Evals and safeguard refusals stay pinned. Every route's Factory skills are linked, and the Command record names each stage's actual Harness. Refs #2183
- Keep the prompt's launch policy for routed implement sessions: the review-report contract still selects the code review session. - Name the branch's open pull request in the Continuation prompt a rerouted implement session starts again with. - Fall back on a startup failure only from security.harness. - Record each stage's Harness, Model and Effort as separate fields. - Share the Security purpose test, the current Choice, the read freshness rule and the windowed-read list; build the implement Opening in one place.
JacobStephens2
marked this pull request as ready for review
November 14, 2026 05:08
This was referenced Nov 14, 2026
Closed
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.
Summary
A factory Command whose Harness comes from
[harness] routesnow routes each session Step by machine-local Plan usage. It picks a route before the Step starts, and moves to the next route when a session stops on structured Plan-usage evidence.ChosenBy::Routesmarks a Choice thatharness.routesmade. Only that routes. A Harness or Model named on the command (--harness,--model), a Step's Harness, Experiments and Scoring runs stay pinned. Spec Tickets inherit the marker through the hidden--sessions-routedflag, and a routed Command's continuation command names no Harness.security.harness, then[security] routes, else[harness] routes, elseharness.default. A pinned review keeps its existing one-time fallback.Built withkeeps the Command's primary tuple. See Decide whether Built with names the route that ran the implement session when Plan usage reroutes #2201 below.Evidence
Execution evidence
This host has no C compiler or linker, so
cargo buildandscripts/affected-testscould not run locally. The evidence below is this PR's CI runs.490423bd):cargo nextest→FAIL thirdshift::codex_sessions implement_sessions_and_their_resumes_request_fresh_reviewers, panicked attests/codex_sessions.rs:133. The routed implement session had lost the review-report launch policy.After (CI run 43559233125, head
51e5b03d):rust-x86 / run (1)–(4)allsuccess. The full x86 suite passes, including:tests/plan_usage_routing.rs, 11 tests: reserve routing, mid-Step commit kept and uncommitted changes discarded with anImplementcontinuation, continuation naming an open PR, conflict-Repair merge reset,security.routesandharness.routeswalking,--harnessand--modelpins, no routing on 429 or agent text, exponential revalidation;src/plan_usage/router.rs,src/session.rs,src/session/kind.rs,src/asks.rsandsrc/child_run.rs.ab508c9c):FAIL session::tests::a_limit_after_work_keeps_commits_discards_the_rest_and_implements_on_as_a_continuation, withleft: ["on claude", "on codex", "reset"].After (head
51e5b03d): passes. The next route is taken before the reset, so with no route left the worktree is kept for Failed run preservation.Visual evidence
The only rendered change is one added paragraph, plus one sentence, in
site/how-it-works/index.html. The cachedchrome-headless-shellrendered that page blank on this host, with or without JavaScript, so no Before/After captures are attached.site-testpasses in CI.Merge Danger
Door: two-way
Routing turns on only when the User config lists two or more
[harness] routes, or setssecurity.harnessbeside routes. Without routes, sessions run exactly as before.Blast Radius: sessions
A routed Step that stops at a Plan-usage limit after doing work discards uncommitted changes in its thirdshift-owned linked worktree. The reset refuses any checkout that is not a linked worktree.
Review coverage
The Standards and Spec reviewers read every changed file. No changed file was left unread, and nothing was excluded as generated.
Unaddressed findings
Standards
Router::pickandsession::routercreate their own dependencies. Declined.plan_usage::credits_allowed(src/plan_usage.rs) loads the User config itself under the samecfg!(test)guard.selectis unit-tested, and the I/O path is exercised end to end bytests/plan_usage_routing.rsin CI.OnMachine::routesandpickare Middle Men overRouter. Declined.Outsideis the session module's test seam. The scriptedRouteddouble insrc/session.rstests the route loop without a machine Plan usage snapshot, which aRouterheld directly would prevent.Spec
Built withnames the Command's first route even when the implement session ran on another route.Built withon "the Command's primary choice". The Spec: view subscription Plan usage and route Steps across Harnesses #583 grill Q2.9(a) instead names "the Harness/Model/Effort that ran the primary implementation session"..models.json, the Command record stages and the Run notification's Session models list.needs-triage).SafeguardRefusal, or a Security run walking routes. Declined.[security] routeswalking and the--modelpin.Router::ofroutes onlyChosenBy::RoutesandChosenBy::SecurityConfigChoices.only_a_choice_the_routes_made_routes_ordinary_sessions(src/plan_usage/router.rs) asserts thatCommand,Step,UserConfigandDefaultstay pinned.ChosenBy::Command(src/trial.rs) and Scoring GradersChosenBy::UserConfig(src/config/scoring.rs).each_route_is_tried_once_and_other_failures_never_route(src/session.rs) covers theSafeguardRefusal. A refusal never reaches the reroute, so the Self-merge hold insrc/run.rsis unchanged.Purpose::is_securitypath as the Security review tested ina_security_review_walks_security_routes_after_its_security_harness.Closes #2183
Built with claude 2.1.322 · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.