Repository navigation
fix(code-mode): continue after proven read-only tool failures - #132146
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
06c37d8 to
af3564a
Compare
|
Codex review: needs changes before merge. Reviewed August 28, 2026, 6:28 PM ET / 22:28 UTC. ClawSweeper reviewWhat this changesThe PR adds host-owned one-shot tool-effect receipts to Code Mode recovery and completes restart-safe reads inline instead of requiring a separate wait turn. Merge readinessKeep open: the new receipt plumbing overrides input-aware core classification with a false exact-instance flag, so a failed Priority: P2 Review scores
Verification
How this fits togetherCode Mode sends model tool calls through the searchable catalog and embedded-agent lifecycle, then decides whether the agent can continue or must enter restricted reconciliation. This change carries private lifecycle effect evidence to that final recovery decision. flowchart LR
A[Model tool call] --> B[Code Mode catalog]
B --> C[Embedded tool lifecycle]
C --> D[Private effect receipt]
D --> E[Recovery eligibility]
E --> F[Continue agent]
E --> G[Restricted reconciliation]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +114, Tests +196. Total +310 across 22 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Pass input-aware effect classification for trusted core actions without allowing a false exact-instance restart-safe flag to erase it, while retaining explicit fail-closed classification for non-core owners. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the added subscribed-lifecycle scenario at src/agents/code-mode.agent-loop.test.ts:464 uses core message action=read, while the introduced executor passes false and forces an uncertain receipt. Tests were not executed because this is a read-only review. Is this the best way to solve the issue? No. The receipt belongs at the lifecycle owner, but the current boolean conflates exact-instance restart safety with input-aware effect classification and defeats the intended core read path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4ad3f71f657b. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Worked on by: - @VACInc Co-authored-by: VACInc <[email protected]>
af3564a to
e01362c
Compare
|
Land-ready verification for
Known proof gap: no external provider/channel live proof was run because this change has no external API or channel boundary. The realistic QuickJS bridge and subscribed agent-loop harnesses exercise the changed runtime path directly. |
|
Merged via squash.
|
Worked on by: - @VACInc Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
Closes #131340
AI-assisted: implemented and reviewed with Codex; the final branch also passed the repository
autoreviewworkflow.What Problem This Solves
Fixes an issue where Code Mode could stop or enter restricted reconciliation after a tool operation that the host had already proven read-only or effect-free. Restart-safe Code Mode also parked audited reads behind unnecessary
waitturns instead of completing them inline.Why This Change Was Made
Tool lifecycle owners now produce a private, one-shot effect receipt for each exact operation. Code Mode carries those receipts across catalog projection, namespace dispatch, suspension, and settlement, while copied values and unknown plugin, MCP, or client effects remain fail-closed. Restart-safe execution drains only calls already proven replay-safe and preserves that restriction when a genuinely slow read must remain suspended.
The implementation keeps post-mutation behavior unchanged: committed or uncertain effects still terminate ordinary continuation and remain eligible only for the existing bounded read-only reconciliation attempt.
User Impact
Code Mode can continue after confirmed reads and no-effect failures without spurious hard stops. Audited restart-safe reads usually finish in the initiating
execcall, while unsafe, side-effecting, MCP, client, approval, cancellation, timeout, and partial-effect paths remain contained.Evidence
waitingand required multiplewaitturns.node scripts/run-vitest.mjs src/agents/code-mode.agent-loop.test.ts src/agents/code-mode.bridge.host-denial.test.ts src/agents/code-mode.bridge.lifecycle.test.ts src/agents/code-mode-namespaces.test.ts src/agents/code-mode.replay.test.ts src/agents/code-mode.wait.test.ts src/agents/embedded-agent-runner/run/code-mode-outcome.test.ts src/agents/embedded-agent-runner/run/attempt-stream-prepare.test.ts src/agents/tool-search-runtime.test.ts src/agents/tool-terminal-outcome.test.ts— 229 tests passed.pnpm tsgo:extensions:test,pnpm tsgo:scripts, andpnpm tsgo:test:root— passed after reproducing and repairing the first exact-head CI failure.node scripts/check-changed.mjs— passed all selected core/extension production and test type, lint, formatting, dead-code, import-cycle, database-first, and boundary gates..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean on the final integrated branch; no accepted/actionable findings.f6805328c434eebb032bced0da29e39ba6dc3aee(codex-rs/core/src/tools/code_mode/execute_handler.rs,delegate.rs, androuter.rs).Worked on by: