Repository navigation
fix(agents): describe settled recovery by behavior - #185351
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR describes settled recovery as a plain-text summarization step and updates fixtures to check recovery behavior rather than advertised tools. Example: Recovery follows the completed write of qa-empty-response-side-effect.txt while native Codex advertises apply_patch.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR makes a useful, narrowly scoped correction to recovery instructions without weakening execution guards; no introduced correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe agent runner selects recovery after completed tool work lacks a final answer, passes recorded results to an isolated harness, and validates the resulting answer before delivery. flowchart TD
A[Completed tool work] --> B[Missing final answer]
B --> C[Recovery instruction]
C --> D[Isolated finalizer]
D --> E[Result validation]
E --> F[Answer and artifact delivery]
Technical reviewBest possible solution: Keep the behavioral instruction at the existing recovery owner while preserving isolation, strict result validation, and effect-based delivery coverage. Do we have a high-confidence way to reproduce the issue? The mismatch is source-reproducible: current main claims tools are unavailable while pinned native Codex can advertise apply_patch without an execution environment; this review ran no target code. Is this the best way to solve the issue? The two sentence replacements are the smallest complete correction, and the fixture changes retain independent execution, provenance, and delivery assertions without adding machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 30210d90e39f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests -19, Other 0. Total -19 across 17 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 11:15 PM ET / October 27, 2026, 03:15 UTC. |
Keep passive recovery for completed tool work that ends without a final reply. Replace the two inaccurate tool-availability sentences with an instruction to summarize recorded results without calling tools. Verify recovery through exactly-once effects, the recovered answer and artifact delivery instead of tool catalogs or prompt text. Preserve existing execution/result guards and the forced-patch rejection regression. Refs openclaw#141705, openclaw#185173.
What Problem This Solves
A turn can finish its side effects and still fail before producing a final answer. Keep the passive recovery that delivers that answer and its artifact, but stop telling the model that tools are unavailable: stock native Codex can advertise
apply_patcheven in the restricted, no-environment recovery turn. Advertisement is not execution.User Impact
Completed work still gets a recovered answer and artifact without repeating effects. Recovery remains passive, with all existing execution and result guards. No configuration or migration is needed.
Why This Change Was Made
This replaces the two misleading sentences with “Do not call tools in this step. Summarize the recorded results in plain text.” The remaining instructions and every execution/result guard stay intact. The Telegram production-path fixture now identifies recovery by request order and the completed tool call ID, and asserts exactly-once effects and delivery instead of a tool catalog or prompt phrase. The native live branch retains its action, summary, binding, and transcript assertions. Existing mock fixtures and the nine QA scenario markers follow the new wording; their effect, cutoff, failure, and delivery assertions remain intact.
#141705 added the old sentence to prevent denied tool calls from discarding an otherwise valid answer. That remains the reason for a clear no-tools behavioral instruction and strict result validation. #185173 demonstrated that native Codex still advertises
apply_patch; its forced-patch rejection regression is preserved unchanged. No upstream Codex change, new capability, schema change, or guard relaxation.Preregistered acceptance (before measurements)
Flow: existing synthetic Telegram write → provider overload → passive recovery → authored final and uploaded artifact through an isolated Gateway, native Codex transport, and synthetic provider/Telegram endpoints. Require exactly one original write, one injected overload, one recovery request carrying the same call ID, one marker answer, one exact-byte file delivery, no new/repeated tool effects, preserved inter-session provenance, and no duplicates after Gateway shutdown. Embedded cutoff/result/transport/delivery tests and prefix-stability must remain green. Normal completed warm turns must not gain a recovery attempt.
Workload: frozen sqlharness v3.1.5, verified against its frozen hashes, one baseline invocation followed by one candidate invocation on this Mac, one repetition each, using the ten warm turns per invocation. Cold/boot/restart phases are reported separately from warm. Report statements, requests and Gateway MAIN median [min–max] and p95; compare per-operation counts. Any new Gateway MAIN work or attributable extra operation is a regression; a 20% adverse cell movement stops acceptance pending attribution. No latency or CPU claim; this is a wording/test-contract correction with expected unchanged work, not a SQL optimization. Counts are the evidence; wall-clock sample size is intentionally insufficient for timing claims.
Evidence
Validation: 287 focused tests passed (including 13 prefix-stability cases, the native forced-patch rejection, and embedded cutoff/result/transport/delivery coverage). The optional credentialed native live case is not counted as proof. The synthetic Telegram production path passed on the final head in CI job 121983439469; its exactly-once and delivery assertions all passed. The corrected subagent recovery scenario passed in job 121983438347. The frozen count pair passed; detailed counts and phase attribution are below. No timing claim is made. Exact-head CI run 40441545305 passed, including the synthetic Telegram E2E, QA smoke, types and lint. Locally, check:changed completed: 36 checks passed; its type/extension-lint checks refused the mandated external dependency store at the declaration-custody boundary, and Knip reported one untouched browser export, reproduced identically by both baseline scans:
extensions/browser/src/browser/client.types.ts: BrowserGraphicsDevice(production 1→1, full-tree 1→1, scripts 0→0). No guard bypass. Runtime import cycles: 0; full Madge check: 0 cycles. T1 168→168, compatibility 15→15, dialect 0→0. Two isolated Codex P0–P2 reviews completed with no actionable findings; each assessed the supplied patch, with unchanged routing implementation outside its context. A third, delta-only review covers the CI-driven test corrections. CI identified a stale QA scenario marker and an overly strict global request-adjacency assertion. Recovery is now required exactly once for the same completed call after the overload, allowing unrelated model requests to interleave. Production is still only two sentence replacements. Final diff: 17 files, +34/-53 (net -19 lines). No SDK surface or PostgreSQL-reachable SQL changes.Open-main-PR overlap: shared PR-index refresh plus base-only versus candidate
git merge-treecomparisons found no added conflict paths or blocks. Peer PRs and conflict-path counts (base→candidate): #185310 0→0, #184434 0→0, #170846 1→1, #165379 39→39, #156181 14→14, #153758 2→2, #147611 8→8, #139929 4→4. Every peer head matched the refreshed index; marker counts also did not rise.Frozen counts
Frozen v3.1.5 verified: 37 files, zero hash mismatches. One sequential baseline/candidate pair on the same Mac; ten warm turns each. Baseline
8e70778f2021ff4f87af712834af665f8d0932cb, candidate4996f75f8274de860ad7706b5f934eea4418af03. Both workloads passed; causal coverage available with no missing warm-turn coverage. Counts only: no latency, CPU, or throughput claim.All ten paired turn-caused samples match: first turn 48 SQL/13 requests, remaining nine 45/12, Gateway MAIN zero throughout. Worker-thread SQL is also identical. No relocation or SQL saving is claimed.
Warm execution-window operation totals (SQL/requests; MAIN is zero for every operation):
AsyncLocalStorage.enterAsyncStoreNO_REQUEST / AsyncLocalStorage.enterAsyncStoreUNKNOWNappendSqliteTrajectoryRuntimeEventsWithWriterapplyPreparedSessionActorAdoptionbatchcommitSessionEntryPatchpluginState.loadNamespaceplugins.catalogSnapshot.writeplugins.metadata.index.refreshprepareMessageRewriteprepareTranscriptPayloadprewarmprojectrecord-runrecordProviderPromptscansession-pending-input-sourcesessionUpstream.listWatchedstatementtrackSessionEntryCacheWriteOther phases remain separate from warm (SQL/requests/Gateway MAIN):
01.boot01.connect02.first-turn04.second-session05.control-plane06.cron07.compaction07.idle-settle07.idle-connected08.shutdown09.restart-boot09.restart-connect10.restart-first-turn11.restart-shutdownThe >20% adverse raw phase moves stopped acceptance for attribution.
agent.worker.openmoves 183 SQL from first-turn to boot but totals exactly 183 SQL/2 requests on both heads.installStatusTrackingmoves 30 SQL/1 request from restart-first-turn to restart-connect, unchanged in total. Memory-index work moves from idle-connected to idle-settle:database.publish42/1,source.replace.group25/1,vector.ensure8/1, cache count 4/1, cache prune 3/1 and metadata write 2/1 are identical overall;session-entriesis 15/2 on both. Combined cold boot/connect/first-turn is 792/200/52 → 813/205/52, combined idle phases 241/54/0 → 237/54/0, restart boot/connect/first-turn 533/181/38 → 522/176/38. Remaining window deltas are existing background/plugin operations; every warm turn-caused sample and all recurring warm owner-operation counts match. Acceptance uses this attribution, not a “within spread” claim.Whole-workload totals: 2885 SQL/774 requests/100 Gateway MAIN → 2869/767/100 (includes boot and shutdown). Unnamed-operation attribution remains 9 SQL and 11→10 requests; these are included in totals, and no complete named attribution is claimed. The two runtime sentence replacements do not add SQL, requests, or execution paths.