feat(orchestration): implement Mode-2 route_to reroute-to-alternate recovery - #6346
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 17, 2026 00:25
bug-ops
force-pushed
the
feat/issue-6244/route-to-redesign
branch
2 times, most recently
from
July 17, 2026 00:36
510388a to
db59cf4
Compare
…ecovery Adds a route_to reroute-to-alternate recovery mode to the orchestration scheduler (LangGraph node-error-handler parity), deferred from the original spec-075 design in PR #6242 after the naive dependency-based approach was found unworkable (N5/N1/N3). A new non-terminal TaskStatus::Dormant state, an on-failure activation edge on RecoveryAction, and a completion-time resolution sweep close those findings; a review round additionally caught that the routed_from prompt injection read TaskNode.result, which no production Failed transition populated, silently defeating the failed-source context injection in real usage. Closes #6244
…erals Two RunningTask test literals in planner.rs and router.rs were missing the last_progress_at field added by the idle_timeout progress-signal feature merged into main, breaking the MSRV/test build.
bug-ops
force-pushed
the
feat/issue-6244/route-to-redesign
branch
from
July 17, 2026 00:46
4d74200 to
359aa4a
Compare
This was referenced Jul 17, 2026
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
route_toreroute-to-alternate-node recovery for the orchestration scheduler (spec075-orchestration-node-control-parityFR-D-01), the LangGraph node-error-handler parity mode deferred from PR spec(075-orchestration-node-control-parity): add specification #6242 after the original naive design (dependency-based dormancy) was found unworkable during a three-round architect/critic review (N5/N1/N3).TaskStatus::Dormantstate,RecoveryAction.route_to: Option<TaskId>on-failure activation edge, and a completion-timeresolve_dormant_after_terminalsweep close N5 (dormancy inversion), N1 (Skip-BFS stranding the fallback's subtree), and N3 (Failed-source output never reaching the fallback's prompt).DispatchStrategy::LevelBarriernow treatsDormantas parked and lets an activated fallback dispatch out-of-level, closing a livelock where a route_to source deeper than its depth-0 fallback would never get scheduled./plan retryre-arms a previously-activated fallback branch back toDormantso retry semantics compose correctly with a prior reroute.Failedeven inside aCompletedgraph (by design, to keep theCompleted-only aggregator/grounding filters from leaking the failure's error into synthesis) and is now tallied intotasks_failed.routed_fromprompt injection readTaskNode.result, which no productionFailed-transition path populated — only theCompletedhandler and Mode-1'stry_recoverwrote it, so the failed-source context injection silently rendered empty outside the one test that hand-fabricated.result. Fixed by populating.resultat all threeFailed-transition sites intick/mod.rs, and replaced the masking test with one that drives the realhandle_failed_outcome/tick()path end-to-end.route_to, like Mode-1'sstate_injection, is authored programmatically rather than exposed to the LLM planner schema.Design process
Full architect → critic (2 rounds) → developer → (tester, perf, security, impl-critic) → reviewer (2 rounds) chain. Design and review handoffs:
.local/handoff/2026-07-16T22-{20-21,28-07,41-21,47-11}-*.md,.local/handoff/2026-07-16T23-{27-47,33-22,33-57,35-46}-*.md,.local/handoff/2026-07-17T{01-23-28,01-37-49,01-57-22}-*.md.Closes #6244
Test plan
dag.rs,scheduler/mod.rs,scheduler/planner.rs,scheduler/router.rs,zeph-core::compaction_e2e— including the two D4 LevelBarrier hang scenarios, aresume_from-specific Dormant-stays-Dormant regression, and an end-to-end real-failure-path prompt-injection testcargo +nightly fmt --checkcleancargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscleancargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 13912/13912 passed, 0 failed, zero regressionsRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace) cleangitleaks protect --stagedclean/plansession test — not yet possible,route_tohas no LLM-facing authoring surface yet (same constraint as Mode-1'sstate_injection); see the playbook's harness-based verification approach instead