Repository navigation
fix(agents): scheduled runs fail after a read or fetch error the model recovered from - #180922
Conversation
… runs A scheduled run that hit a tool error, kept working and ended with NO_REPLY was recorded as failed, with a synthetic tool warning as its result. Code overrode the model's own outcome, and repeated recovered runs could trip failure alerts, repair requests and auto-disable. Respect a deliberate NO_REPLY in scheduled runs as in chat; aborts, runtime errors, timeouts, denied commands and delivery failures keep their fatal paths.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR lets scheduled runs finish successfully with NO_REPLY after ordinary tool errors, without requiring confirmed message-tool delivery. Example: An hourly stock check encounters a view_image error, continues its work, and finishes with NO_REPLY.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this collaborator-authored PR makes a distinct, explicitly chosen change to cron completion policy that remains absent from main; no introduced production defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe embedded runner converts assistant output and tool failures into reply payloads; cron combines those payloads with structured runtime results to determine delivery, history, and failure handling. flowchart LR
A[Scheduled job] --> B[Agent execution]
B --> C[Terminal reply preparation]
C --> D[Reply payload construction]
D --> E[Cron outcome classification]
B --> E
E --> F[Delivery and run history]
E --> G[Failure handling]
Technical reviewBest possible solution: Keep the shared payload owner responsible for authored silence while preserving structured runtime failures as the scheduler’s failure authority. Do we have a high-confidence way to reproduce the issue? Current-main cron preparation passes isCronTrigger=true, causing an ordinary tool error followed by NO_REPLY without confirmed delivery to produce an error payload; no target code was executed during this review. Is this the best way to solve the issue? Removing the exception from the existing payload owner is the smallest complete implementation of the chosen policy, and the caller updates complete the internal cutover. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 06530003a999. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +24, Tests -6, Docs 0, Other +145. Total +163 across 16 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 22, 2026, 3:29 PM ET / 19:29 UTC. |
|
Production evidence for this change, from 2026.10.7 (official image, Linux, isolated cron). Over 14 days, one hourly isolated The narrow unknown-tool exception in #181884 would not cover these, for two reasons:
These false failures also cost more than a status flag. Each one fed |
|
Another 2026.10.7 data point (official image, Linux container), this time with an error the model could not have caused. A manual run of an isolated scheduled So the error this rule promotes isn't always the model's tool use: here it was an internal Gateway failure that the agent could neither avoid nor fix. Respecting |
|
Re-verified 2026-11-29 on our install, OpenClaw 2026.11.6, and on
Question: is this PR still planned to leave draft? If yes, we will treat #207683 as covered by it and validate on the release that ships it. If not, #207683 needs its own fix in the tool-end handler. |
Resolve payloads.errors.test.ts against main's summary table, take main's mock-openai server.ts, and drop the draft's QA scenario, mock planners and the cron regression that passed on base. Remove the last isCronTrigger test inputs.
…l failures - hasCompletedMessagingToolDeliveryEvidence lost its only reader with the cron NO_REPLY guard. - Docs: a job that must report tool failures should reply with the failure instead of NO_REPLY.
|
Review finding accepted (local ClawSweeper round 1 on
|
|
Gateway proof: a built Gateway in secretless Docker, real isolated |
Restore the cron NO_REPLY guard, isCronTrigger and the delivery-evidence helper to main. Recovery is decided in the terminal observer instead: a read-only call that ran and failed changed nothing, so the next successful executed call recovers it. A failed mutation, or a call blocked or denied before it ran, still recovers only through the same tool; missing tools and dispatch keep their rules. A failed read followed by a successful write, or a Code Mode cell that caught a failed nested call and completed, no longer leaves a fatal cron warning. A failure followed by NO_REPLY and nothing else still fails.
|
Gateway proof for the narrowed head |
…-only A failed call is recovered by an unrelated later success only when the catalog's static replay fact proves the tool read-only (read, ls, web_fetch, web_search, memory_get, sessions_*). A failed browser act, or an exec denied after it started, keeps the same-tool rule, so neither can be cleared by a later read.
|
Gateway proof for head |
|
Landed in ee377fc. Scheduled runs are no longer recorded as failed when a read or fetch call failed, the agent then did other work that succeeded, and the run ended quietly. A failed tool followed by a quiet end with no later success still records an error and alerts, and failed browser actions, sends and |
* commit 'ea8cd30a48de1f42962bb95535d2e1b3b201fc36': (599 commits) fix(ui): show a subtle placeholder while a new chat gets its title (#207809) fix: remove dismissed chat suggestions without waiting (#207792) test(gateway): isolate publication recovery memory pressure (#207993) fix(workboard): let users delete an empty default board (#207909) fix(ui): remove Open PR from the session menu (#207808) feat(ui): offer Add to Home agent when Home sidebar is open (#207773) fix(ui): keep narrow desktop composers on desktop icon and control sizes (#207772) fix: remove extra space on the right of the compact iPad chat bar (#207763) fix: keep the task progress options button inside the Details header (#207940) fix(workboard): update the active list when you archive or restore a card (#207790) fix: move dropped sessions into their Workboard column immediately (#207787) fix(whatsapp): retain sender for explicit current-message reactions (#190121) fix: return the agent ID when agents add finishes offline (#207926) fix: stop sending internal steering errors to the chat (#207150) fix(agents): scheduled runs fail after a read or fetch error the model recovered from (#180922) fix: confirm recovered config edits while the Gateway is busy (#207918) fix: make desktop chat presence avatars slightly smaller (#207966) fix: list and select routed Claude models without requiring Claude CLI (#207806) fix(ci): check out verifier before plugin preflight reuse test(reply): prove channel replacement on user messages (#207813) ...
…l recovered from (#180922) Root cause: `src/agents/tool-terminal-outcome.ts:110` (main `ba0a7a5fac`). The terminal observer lets a failed tool call be recovered only by a later success of the same tool name. A run whose `read` or `web_fetch` fails, and that then does other work that succeeds, still ends holding that failure. In a cron run that ends on `NO_REPLY`, `payloads.ts:488` turns it into `⚠️ <Tool> failed` and the run is recorded as `error`. Fixes #207683 ## What Problem This Solves A scheduled run reads or fetches something that fails, keeps working, and ends on `NO_REPLY` with `stopReason: stop`. It is still recorded as failed. That counts toward the error streak, fires failure alerts (each starts a repair turn) and auto-disables one-shot jobs. Reports: - @jaxonparrott, 2026.10.7: 9 of 9 failed runs of one hourly job had this shape (`Web Fetch`, `Wait`, plugin tools). The model kept working after the error, and the next run succeeded. - @abacha, 2026.11.6 and main `cb59aaa3106`, plus #207683: a `web_fetch` inside a Code Mode `exec` cell returns 403 and the cell catches it. The outer `exec` completes and the turn ends on `NO_REPLY`, yet the run is recorded as `error` and the one-shot job is disabled. The nested failure fills the same last-tool-error slot, and the successful outer `exec` cannot clear it because it has a different name. ## Why This Change Was Made The fix is in the observer, where recovery is already decided. Recovery by a later, different call applies only when the failed call actually ran, was not mutating, and its tool has the catalog's static replay-safe fact: `isReplaySafeToolCall(toolName, {})`, which is true for `read`, `ls`, `web_search`, `web_fetch`, `memory_get` and `sessions_*`. Such a call changed nothing, so the next successful executed call recovers it. Nothing else changes: - A failed mutation (a send, write, edit or spawn) still recovers only through the same tool. A failed message send is not undone by a later read (#107735, #139037). - Tools with no catalog read-only fact keep the same-tool rule. A failed browser `act` followed by a successful `read` still reports the browser failure. An `exec`, including one denied with `SYSTEM_RUN_DENIED` after it started, still keeps the cron execution-denied signal. - A call blocked before it ran, the missing-tool rule (#201638) and the dispatch catalog-target rule are unchanged. - The cron `NO_REPLY` guard at `payloads.ts:488` is unchanged. A tool failure followed by `NO_REPLY` with no later successful call still fails the run (#116731, #120056), and so does a missing tool followed by `NO_REPLY` (#201638). No new field, state, config or wording. Limits: - The tool is classified with empty arguments. `subagents`, `session_status` and `presence` count as replay-safe when no action is given, but the stored `mutatingAction` still keeps their mutating actions. A failed `subagents wait` would be recovered, which is harmless. - Tools that are replay-safe only for a specific instance (plugin tools, `replaySafeToolNames`) and read-only `exec` commands such as a failed `cat` keep today's same-tool rule. Recoveries from those still record `error`, as they do on main. Non-cron chat runs: `buildFailureWarning` only adds `⚠️ <Tool> failed` when the turn has no user-facing reply. The one chat change: a turn where one of those catalog read-only calls failed, a different call then ran and succeeded, and the turn ended with no reply text at all no longer gets that warning. Turns with a visible reply or `NO_REPLY` already showed no warning and are unchanged. So are failed mutations, browser and exec failures, and blocked calls. ## User Impact A scheduled job that recovers from a failed `read` or `web_fetch`, including one caught inside a Code Mode cell, and then ends silently now records `ok`. It no longer sends a false failure alert, starts a repair turn or disables itself. A job whose tool failed and that did nothing successful afterwards still fails and alerts. ## Evidence Built Gateway in secretless Docker, real isolated `agentTurn` cron jobs, scripted model. Captures: [evidence comment](#180922 (comment)). | Scenario | main `ba0a7a5fac` | this PR `de3a57c978` | |---|---|---| | (a) `read` fails, `write` succeeds, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | (b) Code Mode cell catches a failed nested `read`, cell completes, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | #116731 shape: `read` fails, `NO_REPLY`, nothing else | `error` `⚠️ Read failed` | `error` `⚠️ Read failed` | | #201638 control: missing tool, `NO_REPLY`, nothing else | `error` `⚠️ Cream Exec blocked` | `error` `⚠️ Cream Exec blocked` | | review regression: browser `act` fails, `read` succeeds, `NO_REPLY` | `error` `⚠️ Browser failed` | `error` `⚠️ Browser failed` | | normal run | `ok`, `succeeded` | `ok`, `succeeded` | New observer regressions in `tool-terminal-outcome.test.ts`: - A failed `read` is cleared by a later successful `write` or `exec`. This fails on main. - A failed `exec` (`SYSTEM_RUN_DENIED`, started, read-only command) and a failed browser `act` are both kept after a successful `read`. The previous head failed both. The existing failed-send case still keeps its warning. The payload, cron, subscribe and Codex dynamic-tool suites pass. The draft's QA scenario, mock planners and extra cron test are dropped. Production: +11/-4 in `src/agents/tool-terminal-outcome.ts` (4 code lines, the rest comment). Tests: +19/-1. Merge danger: two-way door. No state, config or schema changes; a revert restores the old recovery rule. Blast radius: which earlier tool failure a run still reports after later successful work, in cron outcomes and the no-reply chat warning. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit ee377fc) Release adaptation: Apply replay-safe later-tool recovery to the dispatch-by-target observer already backported earlier in this lane. Co-authored-by: RomneyDa <[email protected]>
…l recovered from (#180922) Root cause: `src/agents/tool-terminal-outcome.ts:110` (main `ba0a7a5fac`). The terminal observer lets a failed tool call be recovered only by a later success of the same tool name. A run whose `read` or `web_fetch` fails, and that then does other work that succeeds, still ends holding that failure. In a cron run that ends on `NO_REPLY`, `payloads.ts:488` turns it into `⚠️ <Tool> failed` and the run is recorded as `error`. Fixes #207683 ## What Problem This Solves A scheduled run reads or fetches something that fails, keeps working, and ends on `NO_REPLY` with `stopReason: stop`. It is still recorded as failed. That counts toward the error streak, fires failure alerts (each starts a repair turn) and auto-disables one-shot jobs. Reports: - @jaxonparrott, 2026.10.7: 9 of 9 failed runs of one hourly job had this shape (`Web Fetch`, `Wait`, plugin tools). The model kept working after the error, and the next run succeeded. - @abacha, 2026.11.6 and main `cb59aaa3106`, plus #207683: a `web_fetch` inside a Code Mode `exec` cell returns 403 and the cell catches it. The outer `exec` completes and the turn ends on `NO_REPLY`, yet the run is recorded as `error` and the one-shot job is disabled. The nested failure fills the same last-tool-error slot, and the successful outer `exec` cannot clear it because it has a different name. ## Why This Change Was Made The fix is in the observer, where recovery is already decided. Recovery by a later, different call applies only when the failed call actually ran, was not mutating, and its tool has the catalog's static replay-safe fact: `isReplaySafeToolCall(toolName, {})`, which is true for `read`, `ls`, `web_search`, `web_fetch`, `memory_get` and `sessions_*`. Such a call changed nothing, so the next successful executed call recovers it. Nothing else changes: - A failed mutation (a send, write, edit or spawn) still recovers only through the same tool. A failed message send is not undone by a later read (#107735, #139037). - Tools with no catalog read-only fact keep the same-tool rule. A failed browser `act` followed by a successful `read` still reports the browser failure. An `exec`, including one denied with `SYSTEM_RUN_DENIED` after it started, still keeps the cron execution-denied signal. - A call blocked before it ran, the missing-tool rule (#201638) and the dispatch catalog-target rule are unchanged. - The cron `NO_REPLY` guard at `payloads.ts:488` is unchanged. A tool failure followed by `NO_REPLY` with no later successful call still fails the run (#116731, #120056), and so does a missing tool followed by `NO_REPLY` (#201638). No new field, state, config or wording. Limits: - The tool is classified with empty arguments. `subagents`, `session_status` and `presence` count as replay-safe when no action is given, but the stored `mutatingAction` still keeps their mutating actions. A failed `subagents wait` would be recovered, which is harmless. - Tools that are replay-safe only for a specific instance (plugin tools, `replaySafeToolNames`) and read-only `exec` commands such as a failed `cat` keep today's same-tool rule. Recoveries from those still record `error`, as they do on main. Non-cron chat runs: `buildFailureWarning` only adds `⚠️ <Tool> failed` when the turn has no user-facing reply. The one chat change: a turn where one of those catalog read-only calls failed, a different call then ran and succeeded, and the turn ended with no reply text at all no longer gets that warning. Turns with a visible reply or `NO_REPLY` already showed no warning and are unchanged. So are failed mutations, browser and exec failures, and blocked calls. ## User Impact A scheduled job that recovers from a failed `read` or `web_fetch`, including one caught inside a Code Mode cell, and then ends silently now records `ok`. It no longer sends a false failure alert, starts a repair turn or disables itself. A job whose tool failed and that did nothing successful afterwards still fails and alerts. ## Evidence Built Gateway in secretless Docker, real isolated `agentTurn` cron jobs, scripted model. Captures: [evidence comment](#180922 (comment)). | Scenario | main `ba0a7a5fac` | this PR `de3a57c978` | |---|---|---| | (a) `read` fails, `write` succeeds, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | (b) Code Mode cell catches a failed nested `read`, cell completes, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | #116731 shape: `read` fails, `NO_REPLY`, nothing else | `error` `⚠️ Read failed` | `error` `⚠️ Read failed` | | #201638 control: missing tool, `NO_REPLY`, nothing else | `error` `⚠️ Cream Exec blocked` | `error` `⚠️ Cream Exec blocked` | | review regression: browser `act` fails, `read` succeeds, `NO_REPLY` | `error` `⚠️ Browser failed` | `error` `⚠️ Browser failed` | | normal run | `ok`, `succeeded` | `ok`, `succeeded` | New observer regressions in `tool-terminal-outcome.test.ts`: - A failed `read` is cleared by a later successful `write` or `exec`. This fails on main. - A failed `exec` (`SYSTEM_RUN_DENIED`, started, read-only command) and a failed browser `act` are both kept after a successful `read`. The previous head failed both. The existing failed-send case still keeps its warning. The payload, cron, subscribe and Codex dynamic-tool suites pass. The draft's QA scenario, mock planners and extra cron test are dropped. Production: +11/-4 in `src/agents/tool-terminal-outcome.ts` (4 code lines, the rest comment). Tests: +19/-1. Merge danger: two-way door. No state, config or schema changes; a revert restores the old recovery rule. Blast radius: which earlier tool failure a run still reports after later successful work, in cron outcomes and the no-reply chat warning. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit ee377fc) Companion audit: No later source follow-up; retain the previously ported semantic dispatcher identity and expand only executed read-only recovery. Co-authored-by: RomneyDa <[email protected]>
…l recovered from (openclaw#180922) Root cause: `src/agents/tool-terminal-outcome.ts:110` (main `ccb01ee458`). The terminal observer lets a failed tool call be recovered only by a later success of the same tool name. A run whose `read` or `web_fetch` fails, and that then does other work that succeeds, still ends holding that failure. In a cron run that ends on `NO_REPLY`, `payloads.ts:488` turns it into `⚠️ <Tool> failed` and the run is recorded as `error`. Fixes openclaw#207683 ## What Problem This Solves A scheduled run reads or fetches something that fails, keeps working, and ends on `NO_REPLY` with `stopReason: stop`. It is still recorded as failed. That counts toward the error streak, fires failure alerts (each starts a repair turn) and auto-disables one-shot jobs. Reports: - @jaxonparrott, 2026.10.7: 9 of 9 failed runs of one hourly job had this shape (`Web Fetch`, `Wait`, plugin tools). The model kept working after the error, and the next run succeeded. - @abacha, 2026.11.6 and main `7f1f3242f09`, plus openclaw#207683: a `web_fetch` inside a Code Mode `exec` cell returns 403 and the cell catches it. The outer `exec` completes and the turn ends on `NO_REPLY`, yet the run is recorded as `error` and the one-shot job is disabled. The nested failure fills the same last-tool-error slot, and the successful outer `exec` cannot clear it because it has a different name. ## Why This Change Was Made The fix is in the observer, where recovery is already decided. Recovery by a later, different call applies only when the failed call actually ran, was not mutating, and its tool has the catalog's static replay-safe fact: `isReplaySafeToolCall(toolName, {})`, which is true for `read`, `ls`, `web_search`, `web_fetch`, `memory_get` and `sessions_*`. Such a call changed nothing, so the next successful executed call recovers it. Nothing else changes: - A failed mutation (a send, write, edit or spawn) still recovers only through the same tool. A failed message send is not undone by a later read (openclaw#107735, openclaw#139037). - Tools with no catalog read-only fact keep the same-tool rule. A failed browser `act` followed by a successful `read` still reports the browser failure. An `exec`, including one denied with `SYSTEM_RUN_DENIED` after it started, still keeps the cron execution-denied signal. - A call blocked before it ran, the missing-tool rule (openclaw#201638) and the dispatch catalog-target rule are unchanged. - The cron `NO_REPLY` guard at `payloads.ts:488` is unchanged. A tool failure followed by `NO_REPLY` with no later successful call still fails the run (openclaw#116731, openclaw#120056), and so does a missing tool followed by `NO_REPLY` (openclaw#201638). No new field, state, config or wording. Limits: - The tool is classified with empty arguments. `subagents`, `session_status` and `presence` count as replay-safe when no action is given, but the stored `mutatingAction` still keeps their mutating actions. A failed `subagents wait` would be recovered, which is harmless. - Tools that are replay-safe only for a specific instance (plugin tools, `replaySafeToolNames`) and read-only `exec` commands such as a failed `cat` keep today's same-tool rule. Recoveries from those still record `error`, as they do on main. Non-cron chat runs: `buildFailureWarning` only adds `⚠️ <Tool> failed` when the turn has no user-facing reply. The one chat change: a turn where one of those catalog read-only calls failed, a different call then ran and succeeded, and the turn ended with no reply text at all no longer gets that warning. Turns with a visible reply or `NO_REPLY` already showed no warning and are unchanged. So are failed mutations, browser and exec failures, and blocked calls. ## User Impact A scheduled job that recovers from a failed `read` or `web_fetch`, including one caught inside a Code Mode cell, and then ends silently now records `ok`. It no longer sends a false failure alert, starts a repair turn or disables itself. A job whose tool failed and that did nothing successful afterwards still fails and alerts. ## Evidence Built Gateway in secretless Docker, real isolated `agentTurn` cron jobs, scripted model. Captures: [evidence comment](openclaw#180922 (comment)). | Scenario | main `ccb01ee458` | this PR `de3a57c978` | |---|---|---| | (a) `read` fails, `write` succeeds, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | (b) Code Mode cell catches a failed nested `read`, cell completes, `NO_REPLY` | `error` `⚠️ Read failed`, consecutiveErrors 1 | `ok`, `succeeded`, 0 | | openclaw#116731 shape: `read` fails, `NO_REPLY`, nothing else | `error` `⚠️ Read failed` | `error` `⚠️ Read failed` | | openclaw#201638 control: missing tool, `NO_REPLY`, nothing else | `error` `⚠️ Cream Exec blocked` | `error` `⚠️ Cream Exec blocked` | | review regression: browser `act` fails, `read` succeeds, `NO_REPLY` | `error` `⚠️ Browser failed` | `error` `⚠️ Browser failed` | | normal run | `ok`, `succeeded` | `ok`, `succeeded` | New observer regressions in `tool-terminal-outcome.test.ts`: - A failed `read` is cleared by a later successful `write` or `exec`. This fails on main. - A failed `exec` (`SYSTEM_RUN_DENIED`, started, read-only command) and a failed browser `act` are both kept after a successful `read`. The previous head failed both. The existing failed-send case still keeps its warning. The payload, cron, subscribe and Codex dynamic-tool suites pass. The draft's QA scenario, mock planners and extra cron test are dropped. Production: +11/-4 in `src/agents/tool-terminal-outcome.ts` (4 code lines, the rest comment). Tests: +19/-1. Merge danger: two-way door. No state, config or schema changes; a revert restores the old recovery rule. Blast radius: which earlier tool failure a run still reports after later successful work, in cron outcomes and the no-reply chat warning. Co-authored-by: Ayaan Zaidi <[email protected]>
Root cause:
src/agents/tool-terminal-outcome.ts:110(mainba0a7a5fac). The terminal observer lets a failed tool call be recovered only by a later success of the same tool name. A run whosereadorweb_fetchfails, and that then does other work that succeeds, still ends holding that failure. In a cron run that ends onNO_REPLY,payloads.ts:488turns it into⚠️ <Tool> failedand the run is recorded aserror.Fixes #207683
What Problem This Solves
A scheduled run reads or fetches something that fails, keeps working, and ends on
NO_REPLYwithstopReason: stop. It is still recorded as failed. That counts toward the error streak, fires failure alerts (each starts a repair turn) and auto-disables one-shot jobs.Reports:
Web Fetch,Wait, plugin tools). The model kept working after the error, and the next run succeeded.cb59aaa3106, plus [Bug]: Nested Code Mode tool call caught by the guest's try/catch becomes lastToolError and fails a silent cron run (status=error, one-shot auto-disabled) #207683: aweb_fetchinside a Code Modeexeccell returns 403 and the cell catches it. The outerexeccompletes and the turn ends onNO_REPLY, yet the run is recorded aserrorand the one-shot job is disabled. The nested failure fills the same last-tool-error slot, and the successful outerexeccannot clear it because it has a different name.Why This Change Was Made
The fix is in the observer, where recovery is already decided. Recovery by a later, different call applies only when the failed call actually ran, was not mutating, and its tool has the catalog's static replay-safe fact:
isReplaySafeToolCall(toolName, {}), which is true forread,ls,web_search,web_fetch,memory_getandsessions_*. Such a call changed nothing, so the next successful executed call recovers it. Nothing else changes:actfollowed by a successfulreadstill reports the browser failure. Anexec, including one denied withSYSTEM_RUN_DENIEDafter it started, still keeps the cron execution-denied signal.NO_REPLYguard atpayloads.ts:488is unchanged. A tool failure followed byNO_REPLYwith no later successful call still fails the run (Cron failureAlert silently swallowed by quiet exits and misses WSL2 drvfs mount failure #116731, fix(cron): preserve tool failures after silent replies #120056), and so does a missing tool followed byNO_REPLY(fix(agents): scheduled runs that recover from calling a missing tool are recorded failed #201638).No new field, state, config or wording.
Limits:
subagents,session_statusandpresencecount as replay-safe when no action is given, but the storedmutatingActionstill keeps their mutating actions. A failedsubagents waitwould be recovered, which is harmless.replaySafeToolNames) and read-onlyexeccommands such as a failedcatkeep today's same-tool rule. Recoveries from those still recorderror, as they do on main.Non-cron chat runs:
buildFailureWarningonly adds⚠️ <Tool> failedwhen the turn has no user-facing reply. The one chat change: a turn where one of those catalog read-only calls failed, a different call then ran and succeeded, and the turn ended with no reply text at all no longer gets that warning. Turns with a visible reply orNO_REPLYalready showed no warning and are unchanged. So are failed mutations, browser and exec failures, and blocked calls.User Impact
A scheduled job that recovers from a failed
readorweb_fetch, including one caught inside a Code Mode cell, and then ends silently now recordsok. It no longer sends a false failure alert, starts a repair turn or disables itself. A job whose tool failed and that did nothing successful afterwards still fails and alerts.Evidence
Built Gateway in secretless Docker, real isolated
agentTurncron jobs, scripted model. Captures: evidence comment.ba0a7a5facde3a57c978readfails,writesucceeds,NO_REPLYerror⚠️ Read failed, consecutiveErrors 1ok,succeeded, 0read, cell completes,NO_REPLYerror⚠️ Read failed, consecutiveErrors 1ok,succeeded, 0readfails,NO_REPLY, nothing elseerror⚠️ Read failederror⚠️ Read failedNO_REPLY, nothing elseerror⚠️ Cream Exec blockederror⚠️ Cream Exec blockedactfails,readsucceeds,NO_REPLYerror⚠️ Browser failederror⚠️ Browser failedok,succeededok,succeededNew observer regressions in
tool-terminal-outcome.test.ts:readis cleared by a later successfulwriteorexec. This fails on main.exec(SYSTEM_RUN_DENIED, started, read-only command) and a failed browseractare both kept after a successfulread. The previous head failed both.The existing failed-send case still keeps its warning. The payload, cron, subscribe and Codex dynamic-tool suites pass. The draft's QA scenario, mock planners and extra cron test are dropped.
Production: +11/-4 in
src/agents/tool-terminal-outcome.ts(4 code lines, the rest comment). Tests: +19/-1.Merge danger: two-way door. No state, config or schema changes; a revert restores the old recovery rule. Blast radius: which earlier tool failure a run still reports after later successful work, in cron outcomes and the no-reply chat warning.