You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(runtime): reroute failed dispatches after reconciliation - #205
Temporary capacity, transport, timeout, and quota failures can now use the configured fallback once for that stage, after proving the previous process group has exited. Started or unknown attempts reconcile local work and GitHub publications first; changed or unavailable evidence stops the cycle without repeating implementation or review.
Implementation run: profile deep_coder, requested model openai/gpt-6.1-sol, resolved model ?, effort medium.
Diagnosis
This is a feature request. The existing recorder rerouted quota failures only and changed executor availability for later stages. #172's classification and start evidence are already merged; #174's recovery remains separate. Basic and widened searches covered dispatch, fallback, reroute, and the shared recorder, including #172, #174, and #122. No defect reproduction applies.
The invariant is that a stage has one shared retry budget, cannot overlap its previous process, and cannot blindly repeat external effects. The change adds native process-group exit evidence, transient before/after workspace and publication snapshots, closed telemetry decision/reason tokens, and a stage-local fallback target. Authentication, precondition, contract, and result-recovery errors remain outside this retry path. Calibration never reroutes.
Work units
Unit
Behaviour
Files
Tests
Verification
Rollback
WU-1
Retry eligible dispatch failures once after exit proof and reconciliation
rtk proxy python3 -m unittest discover -s tests -p test_reroute.py — exit 0; 6 boundary tests using real subprocesses and disposable Git repositories.
python3 -m unittest discover -s tests -v — exit 0; 1191 tests, including the installed runtime with fake agent binaries, one capacity fallback, and the shared quota budget.
Tests that create commits supply their own identity; process/publication tests use disposable repositories, fake agents, or mocked GitHub responses. The local run uses Linux, Python, Git, and Bash as Linux CI does; Windows and installer matrix checks run on the pushed head in CI. No live agent quota was consumed to induce a failure.
Native POSIX dispatches stop remaining process-group children before reporting exit proof. Windows lacks group exit proof and conservatively stops. Unsupported or unreadable publication boundaries stop; GitHub reconciliation verifies the origin repository before using gh. Snapshots remain transient, and telemetry stores only closed tokens and flags. Restored remote effects between snapshots cannot be detected.
Checks of the final head
Head: c24bfd44de6313a6035fd6d4e458811605a57a20.
Trigger
Check
State
push
Skills, manifests, and Bash installer
pass
pull_request
Skills, manifests, and Bash installer
pass
push
PowerShell installer
pass
pull_request
PowerShell installer
pass
All four checks passed; none failed or remains pending. The branch and its task-specific linked worktree are retained for resolution on this same PR.
[CCR-20261008-001] · reviewer · anthropic/claude-sonnet-5-5→? · high · schema:1
Initial review of #205 — APPROVED (3 non-blocking findings)
Reviewed: accumulated diff 9c43763…c24bfd4 (787 lines, SHA-256 c0988cbd…65df7, 14 files) against the full diff, not only the last commit. Head reviewed = current PR head c24bfd44de6313a6035fd6d4e458811605a57a20. Conventions applied: AGENTS.md and CONTRIBUTING.md; no security_review.always_when rule is declared, so the skill defaults apply.
Summary. The change implements #173 as specified in the issue's review decisions: one stage-local reroute shared with the quota budget, process-group exit proof, direct reroute for not_started, workspace/remote/PR/comment/review/issue-comment reconciliation for started/unknown writing or publishing attempts, fail-closed on unavailable evidence, calibration never reroutes, closed telemetry tokens, and later stages keep their original availability. I found no correctness defect in the branches I traced (exit proof → human action → start state → effects → fallback availability). The reasons emitted in cycle.py and the reroute_reason tokens in telemetry.py match one to one.
Findings
[REV-001] · low · open · - · blocks:no — Interrupt path now SIGKILLs at once and _stop_process is dead code
scripts/executors.py:504, scripts/executors.py:464-480. _run used _stop_process(process) (SIGTERM with a grace period) when the cycle was interrupted. It now calls _reap_process_group, which sends SIGKILL to the whole group immediately, and _stop_process has no remaining caller (grep -rn _stop_process scripts tests finds only the definition). The agent loses its chance to flush or release locks on Ctrl-C. Either restore a graceful TERM→KILL on the interrupt path or delete the unused helper.
[REV-002] · low · open · - · blocks:no — CHANGELOG.md[Unreleased] not updated
CHANGELOG.md. The previous behaviour-changing runtime PRs (#195, #200) each added an [Unreleased] entry. This one changes observable behaviour (quota/capacity/transport/timeout reroute policy, availability no longer updated after a quota failure, POSIX dispatches run in their own session and descendants are killed on exit, Windows no longer reroutes automatically) and adds a runtime file, but has no entry.
[REV-003] · low · open · - · blocks:no — Publication snapshot misses some external effects
scripts/reroute.py:366-386. The snapshot reads PR number,headRefOid,state and the three comment/review endpoints plus issue comments. A started attempt that only edited the PR title/body, labels, or draft state, or resolved a review thread without replying, leaves the snapshot unchanged, so reconcile returns reroute/no_effects and the stage runs again. The PR text already says restored remote effects cannot be detected; this is the narrower case of effects that are never captured. Adding title,body,labels,isDraft to the --json list would cover most of it. Not blocking because the issue's stated boundary is push, comment and dirty workspace.
Security triage
Not a sensitive change by the default list (no auth, sessions, authorization, user input, secrets, dependencies, CI or deployment configuration touched), and no repository rule is declared, so no rule half fired. My own reading found subprocess use and process control: gh and git are called with list argv and no shell, and the origin URL is matched against a strict GitHub pattern and compared with the repository before any gh call. The audit was therefore skipped after triage; nothing here needed a separate pass.
python3 -m unittest discover -s tests → exit 0, Ran 1191 tests … OK (matches the PR's count).
_run probe: a parent that spawns a 30 s child returned returncode=0, process_exited=True immediately; the child was killed with its group.
Read the full diff in sections; traced Claude/Codex through the shared NativeAdapter.dispatch so both carry process_exited.
Unverified
Live gh reconciliation against real GitHub (only mocked in tests/test_reroute.py).
Windows behaviour (exit proof is always False, so every transient failure stops); CI covers installer and unit tests there but not a reroute.
Cost of the pre-dispatch snapshot: each writing or publishing stage now makes up to five sequential gh calls plus git ls-remote per remote before dispatch, including stages that succeed. Not measured.
CI (head c24bfd4)
Skills, manifests, and Bash installer — pass (push and pull_request). PowerShell installer — pass (push and pull_request). 4/4 pass, none pending, skipped, or missing; both jobs run the unit suite.
Residual risks
Descendants that leave the process group (setsid) are not covered by the group exit proof.
Plane/Jira work-item IDs are non-decimal, so publishing stages in those cycles always stop (evidence_unavailable) rather than reroute; fail-closed, as documented.
Verdict
APPROVED — current HEAD fully reviewed, all required checks pass, no open finding blocks approval. REV-001…REV-003 are optional follow-ups for the author.
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
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.
Temporary capacity, transport, timeout, and quota failures can now use the configured fallback once for that stage, after proving the previous process group has exited. Started or unknown attempts reconcile local work and GitHub publications first; changed or unavailable evidence stops the cycle without repeating implementation or review.
Work item: #173 — #173
Implementation run: profile
deep_coder, requested modelopenai/gpt-6.1-sol, resolved model?, effortmedium.Diagnosis
This is a feature request. The existing recorder rerouted quota failures only and changed executor availability for later stages. #172's classification and start evidence are already merged; #174's recovery remains separate. Basic and widened searches covered dispatch, fallback, reroute, and the shared recorder, including #172, #174, and #122. No defect reproduction applies.
The invariant is that a stage has one shared retry budget, cannot overlap its previous process, and cannot blindly repeat external effects. The change adds native process-group exit evidence, transient before/after workspace and publication snapshots, closed telemetry decision/reason tokens, and a stage-local fallback target. Authentication, precondition, contract, and result-recovery errors remain outside this retry path. Calibration never reroutes.
Work units
scripts/cycle.py,executors.py,reroute.py,router.py,run_cycle.py,telemetry.py,runtime.manifest;docs/routing.md,telemetry.md; five test/fixture filesVerification
Agent-reported evidence, recorded by cc-verify:
rtk proxy python3 scripts/validate-package.py— exit 0; no test count.rtk proxy python3 -m unittest discover -s tests -p test_cycle.py— exit 0; 54 tests.rtk proxy python3 -m unittest discover -s tests -p test_executors.py— exit 0; 166 tests.rtk proxy python3 -m unittest discover -s tests -p test_reroute.py— exit 0; 6 boundary tests using real subprocesses and disposable Git repositories.python3 -m unittest discover -s tests -v— exit 0; 1191 tests, including the installed runtime with fake agent binaries, one capacity fallback, and the shared quota budget.Tests that create commits supply their own identity; process/publication tests use disposable repositories, fake agents, or mocked GitHub responses. The local run uses Linux, Python, Git, and Bash as Linux CI does; Windows and installer matrix checks run on the pushed head in CI. No live agent quota was consumed to induce a failure.
Native POSIX dispatches stop remaining process-group children before reporting exit proof. Windows lacks group exit proof and conservatively stops. Unsupported or unreadable publication boundaries stop; GitHub reconciliation verifies the origin repository before using
gh. Snapshots remain transient, and telemetry stores only closed tokens and flags. Restored remote effects between snapshots cannot be detected.Checks of the final head
Head:
c24bfd44de6313a6035fd6d4e458811605a57a20.All four checks passed; none failed or remains pending. The branch and its task-specific linked worktree are retained for resolution on this same PR.
Closes #173