Skip to content

fix: keep Code Mode restricted after an unrelated failed wait - #128098

Merged
steipete merged 1 commit into
mainfrom
steipete/sweet-goldstine-7c9010
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/sweet-goldstine-7c9010

Conversation

@steipete

Copy link
Copy Markdown
Contributor
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 forceCodeModeTools was unexpectedly true:

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:

node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts -t 'mismatched failed-wait result identity' # 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 # passed

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.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 03:37
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 4b5fe55c59c5ff1403f77078ba67f793515ed906.

The pre-fix owner-boundary regression failed because an unrelated failed wait incorrectly set forceCodeModeTools: true. The canonical fix removes the duplicate run-ID-only restoration path; exactly matched wait identities still restore Code Mode, while mismatched, missing, and duplicate identities remain restricted.

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
# passed

Exact-head hosted CI/Testbox: run 32615807819, completed successfully, including openclaw/ci-gate.

Production +1/-5 (net -4); tests +50/-24 (net +26). Fresh automated code review found no actionable findings, and the native landing review artifacts validate with the required ready recommendation.

ClawSweeper has acknowledged and started its exact-head review; no completed review or Rank-up moves: had been published at the time of this comment, so there are presently no actionable moves to apply or skip. No live-provider or UI proof is applicable because this is deterministic transcript recovery policy verified at the recovery owner boundary. No remaining proof gaps.

@steipete
steipete merged commit af9a230 into main Aug 23, 2026
294 checks passed
@steipete
steipete deleted the steipete/sweet-goldstine-7c9010 branch August 23, 2026 03:49
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant