fix(cron): respect recovered tool errors#84156
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-19 14:18 UTC / May 19, 2026, 10:18 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Current main has a focused resolver test and helper logic showing all-error payloads with final assistant text still select the last error, and PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the resolver-level fix once maintainers accept the recovered-terminal-assistant status contract for cron monitoring and are satisfied that the focused helper proof covers the risk. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a focused resolver test and helper logic showing all-error payloads with final assistant text still select the last error, and Is this the best way to solve the issue? Yes, with a maintainer policy check. The PR fixes the implicated resolver instead of only changing summary text, while preserving typed run failures, fatal failure signals, denial markers, and structured delivery safeguards. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 13c97c5a8d04. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Brave Shellbean Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
Summary
isErrortool payloads, even though the agent produced terminal assistant-visible output.resolveCronPayloadOutcomenow recordserrorPayloadRecoveryand treats later payload output, message-delivery warnings, or terminal assistant-visible text as recovery paths when no typed fatal signal exists.meta.error, fatalfailureSignal, denial markers, structured/media delivery payload handling, and real unrecovered trailing errors remain fatal.Motivation
errorbecause an intermediate tool failure wins over the recovered final assistant result.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
okinstead oferrorwhen the only remaining error evidence is recoverable tool payload text.fix/cron-recovered-tool-errorat commit3cb013e77a.{ "hasFatalErrorPayload": false, "status": "ok", "outputText": "Recovered final answer from the cron task.", "deliveryPayloads": [ { "text": "Recovered final answer from the cron task." } ], "errorPayloadRecovery": { "hadErrorPayload": true, "recovered": true, "recoveredBy": "terminalAssistantText" }, "embeddedRunError": null }hasFatalErrorPayloadis false, and the final status derived by cron isok.finalAssistantVisibleTextwas present.Root Cause (if applicable)
resolveCronPayloadOutcomeclassified any lastisErrorpayload as fatal unless a later non-error payload existed, so all-error-payload runs could not be recovered by terminal assistant-visible text.finalAssistantVisibleText, but fatal payload classification ran before that text could act as recovered terminal output.Regression Test Plan (if applicable)
src/cron/isolated-agent.helpers.test.tsisError, final assistant-visible text is present and preferred, no typed fatal signal exists, and cron resolves anokoutcome with recovered final text.User-visible / Behavior Changes
Cron runs that recover from intermediate tool errors can now be recorded as successful and surface the final assistant result instead of the last recoverable tool error.
Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
preferFinalAssistantVisibleText: trueSteps
resolveCronPayloadOutcome.hasFatalErrorPayloadresolves false and output/delivery use final assistant text.Expected
Actual
status: "ok",recoveredBy: "terminalAssistantText", and no embedded run error.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test; focused tests andpnpm build/pnpm checkwere run instead.codex review --base origin/main; the installed Codex CLI does not expose areviewsubcommand, and a read-onlycodex execreview attempt failed with401 Unauthorized.AI-assisted: yes. I understand the changed classifier path and the added tests.
Validation run locally:
Review Conversations
No bot review conversations were open when this PR body was updated.
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations
meta.error, fatalfailureSignal, denial markers, structured delivery payloads, or an unrecovered real trailing error should stay fatal.