fix(cron): detect recovered tool warnings without preferFinalAssistantVisibleText#94849
Conversation
…tVisibleText - Removed preferFinalAssistantVisibleText === true requirement from hasRecoveredToolWarning so that recovery detection works for all channels (e.g. Feishu) regardless of their output preference - Added test verifying recovery detection without the channel flag Fixes openclaw#94846
|
Codex review: needs changes before merge. Reviewed June 25, 2026, 11:24 PM ET / 03:24 UTC. Summary PR surface: Source -1, Tests +22. Total +21 across 2 files. Reproducibility: yes. source-level: current main still requires the channel final-text preference before recovered tool warnings can clear fatality and select final assistant text. I did not run a live Feishu or Slack scheduled cron in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Land one canonical narrow cron payload-outcome fix that keeps true fatal structured errors fatal, proves false-policy recovered warning delivery with a regression that fails on main, and closes the linked issue after merge. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main still requires the channel final-text preference before recovered tool warnings can clear fatality and select final assistant text. I did not run a live Feishu or Slack scheduled cron in this read-only review. Is this the best way to solve the issue? Yes for the narrow tool-warning scope: resolveCronPayloadOutcome is the shared decision point before cron finalization dispatch. The mergeable shape should tighten the regression test and let maintainers choose the canonical branch among overlapping fixes. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 448b7c75b669. Label changesLabel justifications:
Evidence reviewedPR surface: Source -1, Tests +22. Total +21 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
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. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…antVisibleText hasRecoveredToolWarning already detects recovery without preferFinalAssistantVisibleText, but shouldUseFinalAssistantVisibleText still required the flag, so Feishu-like channels still got the stale warning payload instead of the final assistant text. Adding || hasRecoveredToolWarning ensures the recovery also controls which text is selected for delivery payload. Updated test assertions to verify outputText and deliveryPayloads in the no-preference case.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
maintainer closeout after re-review against current The The added regression also does not exercise the changed path: it includes a successful payload after the error, so current The July 2 report is still valid, but its sanitized evidence does not distinguish an exec preflight rejection from an actual subprocess failure. A safe fix needs typed producer evidence, such as exec failure phase/process-started metadata, and cron must consume that metadata rather than infer semantics from display text. If an ambiguous/mutating command actually ran, the broader product fix is a first-class degraded/warning cron outcome across persistence, delivery, alerts, and retry/backoff; this helper-only patch cannot represent that safely. Closing this candidate rather than landing behavior that can hide failed side effects. The canonical issue remains open for the typed fix. |
Summary
An isolated scheduled
agentTurnthat recovers from an early tool error,produces final assistant output, and ends with
status=successshould stillbe eligible for delivery dispatch. Instead,
hasRecoveredToolWarninginresolveCronPayloadOutcomeblocked recovery andshouldUseFinalAssistantVisibleTextrequired
preferFinalAssistantVisibleText === true, which caused channelslike Feishu (where this flag is false) to classify the recovered run as having
a fatal structured error payload, causing
finalizeCronRunto return beforedispatchCronDeliverywas reached.Fix: Two changes to
src/cron/isolated-agent/helpers.ts:preferFinalAssistantVisibleText === truerequirement fromhasRecoveredToolWarningso recovery detection depends on agent behavior(final output + all errors are tool warnings), not on channel preference.
|| hasRecoveredToolWarningtoshouldUseFinalAssistantVisibleTextso that recovered runs on non-preference channels still deliver the final
assistant text instead of the stale warning payload.
Fixes #94846
Real behavior proof
Behavior or issue addressed: An isolated cron agent that hits a temporary
tool warning (e.g.
⚠️ 🛠️ get_weather: API rate limited) but then recoversand produces valid final output was incorrectly classified as having a fatal
error on channels where
preferFinalAssistantVisibleTextisfalse(e.g.Feishu). This caused
finalizeCronRunto skip delivery dispatch entirely.Real environment tested: Linux x64 (kernel 4.19.112), Node.js v24.13.1,
OpenClaw commit 4d019f7.
Exact steps or command run after this patch:
After-fix evidence:
Observed result after the fix:
resolveCronPayloadOutcomecorrectlydetects recovered tool warnings regardless of
preferFinalAssistantVisibleText.Feishu-like channels now receive delivery dispatch with the final assistant
text, while non-tool errors and runs without final output remain correctly
classified as fatal. All existing Telegram-like behavior is preserved.
What was not tested: Live Feishu channel delivery. The proof validates
the
resolveCronPayloadOutcomefunction at the runtime contract level usingthe same source that production channels use.
Tests and validation
detects recovered tool warnings without preferFinalAssistantVisibleTexttest to verify
outputTextanddeliveryPayloadsare correctly setresolveCronPayloadOutcometests pass unchangedRisk checklist
Did user-visible behavior change? (
Yes/No)Yes— Feishu (and other channels withoutpreferFinalAssistantVisibleText)will now receive delivery for recovered tool-warning runs, instead of silently
skipping delivery.
Did config, environment, or migration behavior change? (
Yes/No)NoDid security, auth, secrets, network, or tool execution behavior change? (
Yes/No)NoWhat is the highest-risk area?
⚠️ 🛠️prefix) butwere previously intentionally treated as fatal due to channel preference
— now they will proceed to delivery dispatch.
How is that risk mitigated?
isCronToolWarningonly matches the explicit⚠️ 🛠️prefix, sonon-tool errors (other prefixes, plain text) remain unaffected
shouldUseFinalAssistantVisibleTextstill independently respectschannel preference for which text goes into the delivery payload
normalizedFinalAssistantVisibleText !== undefined)ensures the agent actually produced final output before marking run as recovered
Current review state
What is the next action?