Repository navigation
fix: keep Code Mode restricted after an unrelated failed wait - #128098
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for exact head The pre-fix owner-boundary regression failed because an unrelated failed wait incorrectly set Local verification: node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts -t 'mismatched failed-wait result identity'
# pre-fix: failed; post-fix: passed
node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts
# 163 passed
node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery-resume-policy.test.ts
# 18 passed
node scripts/check-changed.mjs -- src/agents/main-session-recovery/main-session-restart-recovery-resume-policy.ts src/agents/main-session-recovery/main-session-restart-recovery.test.ts
# all gates passed
git diff --check
# passedExact-head hosted CI/Testbox: run 32615807819, completed successfully, including Production ClawSweeper has acknowledged and started its exact-head review; no completed review or |
|
Merged via squash.
|
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users recovering after a Gateway restart could have Code Mode tools re-enabled by an unrelated failed wait result when a replay-safe checkpoint for the same run was nearby.
Why This Change Was Made
Exact tool-call identity is authoritative when deciding whether a failed wait belongs to the preceding Code Mode wait. Remove the duplicate run-ID-only restoration path so the existing identity-checked artifact handling and canonical checkpoint path remain the sole owners of Code Mode restoration.
User Impact
Unrelated, missing, and duplicate failed wait identities remain restart-safe and restricted after recovery. Exactly one matching failed wait still restores Code Mode tools when its checkpoint is replay-safe.
Evidence
Before the fix, the focused regression failed because
forceCodeModeToolswas unexpectedlytrue:node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts -t 'mismatched failed-wait result identity'After the fix:
Production:
+1/-5(net-4); tests:+50/-24(net+26). No live provider or UI proof is applicable: this is deterministic transcript recovery policy with owner-boundary regression coverage across matching, mismatched, missing, and duplicate identities.AI-assisted. The author reviewed and understands the change; fresh automated code review reported no actionable findings.