Repository navigation
fix: continue code mode with read-only recovery - #128071
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
cf61c31 to
2d09902
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 10:54 PM ET / August 23, 2026, 02:54 UTC. ClawSweeper reviewWhat this changesThe branch adds one host-created, read-only reconciliation attempt after a settled Code Mode bridge failure that may have partially applied a mutation. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe PR remains necessary and appears to implement the linked Code Mode recovery bug without replaying the mutation. The new attempt is gated on the final prompt-policy decision and reconstructs only the core read surface; exact-head checks are still running. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe embedded agent runner executes Code Mode bridge calls inside an agent tool loop. After an unsafe mutation failure, this change can start one fresh attempt that inspects the resulting workspace state and returns an accurate recovery report. flowchart LR
A[Code Mode mutation] --> B[Bridge dispatch]
B --> C{Partial failure}
C --> D[Settled-attempt gate]
D --> E{Core read was authorized}
E -->|yes| F[Read-only reconciliation]
E -->|no| G[Terminal response]
F --> H[Authoritative state report]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +223, Tests +175. Total +398 across 27 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Keep the one-shot recovery at the embedded-runner owner boundary, with only core read reconstructed after final prompt-policy authorization and exact-head validation complete. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a bridge-started Code Mode failure is terminal on current main, while this branch admits a second attempt only after the original final prompt policy authorizes core read. Is this the best way to solve the issue? Yes. The repair preserves the no-replay invariant at the Code Mode owner while offering a narrowly constructed, one-shot observation path rather than a downstream retry or broad fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 672ac118c34f. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (2 earlier review cycles)
|
aa5cf25 to
820f15e
Compare
820f15e to
55e597f
Compare
55e597f to
6ca4404
Compare
|
Fixed: Code Mode can now report partial mutation state through a final-policy-authorized read-only reconciliation attempt without replaying the mutation. |
Preserve failed Code Mode mutations without replay while allowing one final-policy-authorized core-read reconciliation attempt to report partial application state. Fixes openclaw#128028.
Summary
readtoolreadshadows; reconstruct only the built-in corereadtoolRoot cause
After bridge dispatch starts, Code Mode correctly refuses to replay a failed mutation. The repair hook also terminates the outer tool loop, so a partially applied operation ends the run before the model can inspect and report the authoritative resulting state.
The fix records only the narrow unsafe-dispatch case, carries that fact to the embedded run owner, and permits one host-created reconciliation phase when all tool and side-effect lifecycles are settled. Candidate minting consumes the original turn’s final prompt-policy decision, after
before_prompt_buildintersects the concrete host surface. Explicit empty, deny, sandbox, sender, inherited, runtime, and prompt-specific policies remain authoritative. Plugin or channel tools namedreaddo not qualify.Verification
apply_patchbridge call: the first hunk applied, the second failed as ambiguous, and the run terminated without inspectionreadshadows are rejectedpnpm tsgo:corepnpm check:changed -- <changed files>openai/codex@8e649e3afa5cdddfb09a1b85a090b94775045d9b; it has no reusable read-only recovery contractFixes #128028