fix(cron): trust agent output when channel is unresolved without explicit delivery#92817
Conversation
…icit delivery resolveCronChannelOutputPolicy checked deliveryRequested === false when there is no channel. Since deliveryRequested is optional (?: boolean), undefined and missing opts both returned false, blocking the hasRecoveredToolWarning rescue path for --no-deliver cron runs whose agent recovered successfully. Change === false to !== true: when no channel exists, prefer the agent's final visible text unless delivery was explicitly requested. Fixes openclaw#90664 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed June 13, 2026, 9:19 PM ET / 01:19 UTC. Summary PR surface: Source 0, Tests +10. Total +10 across 2 files. Reproducibility: yes. for the helper edge: current main returns false when the no-channel policy is called with undefined or missing options. No for the full user workflow: the normal product caller I found already passes a boolean Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Accept the PR only if maintainers want absent Do we have a high-confidence way to reproduce the issue? Yes for the helper edge: current main returns false when the no-channel policy is called with undefined or missing options. No for the full user workflow: the normal product caller I found already passes a boolean Is this the best way to solve the issue? Unclear as a fix for the linked user issue because the main cron path already appears to cover bare no-deliver runs with an explicit false value. As a defensive helper semantic, the PR is narrow and preserves explicit delivery-requested behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b3dc27403498. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source 0, Tests +10. Total +10 across 2 files. View PR surface stats
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
|
|
@vincentkoc would you mind reviewing this? 1-char fix for #90664 — closes the edge case that the earlier fix missed in the path. Thanks! |
…icit delivery (openclaw#92817) resolveCronChannelOutputPolicy checked deliveryRequested === false when there is no channel. Since deliveryRequested is optional (?: boolean), undefined and missing opts both returned false, blocking the hasRecoveredToolWarning rescue path for --no-deliver cron runs whose agent recovered successfully. Change === false to !== true: when no channel exists, prefer the agent's final visible text unless delivery was explicitly requested. Fixes openclaw#90664 Co-authored-by: Claude Fable 5 <[email protected]>
…icit delivery (openclaw#92817) resolveCronChannelOutputPolicy checked deliveryRequested === false when there is no channel. Since deliveryRequested is optional (?: boolean), undefined and missing opts both returned false, blocking the hasRecoveredToolWarning rescue path for --no-deliver cron runs whose agent recovered successfully. Change === false to !== true: when no channel exists, prefer the agent's final visible text unless delivery was explicitly requested. Fixes openclaw#90664 Co-authored-by: Claude Fable 5 <[email protected]>
…icit delivery (openclaw#92817) resolveCronChannelOutputPolicy checked deliveryRequested === false when there is no channel. Since deliveryRequested is optional (?: boolean), undefined and missing opts both returned false, blocking the hasRecoveredToolWarning rescue path for --no-deliver cron runs whose agent recovered successfully. Change === false to !== true: when no channel exists, prefer the agent's final visible text unless delivery was explicitly requested. Fixes openclaw#90664 Co-authored-by: Claude Fable 5 <[email protected]>
Summary
--no-delivercron jobs that encounter recoverable tool warnings were markedstatus: erroreven when the agent successfully produced a final answer.The basic fix (
deliveryRequested === false) was already implemented on main, but it missed the edge case wheredeliveryRequestedisundefined— which happens in therun-executor.tscode path where the field is typed?: boolean.Fix
One character in
src/cron/isolated-agent/channel-output-policy.ts:When no channel exists, trust the agent's final visible text unless delivery was explicitly requested (
=== true).false,undefined, and missing opts all mean "not requested" → allow the rescue path.This closes the gap left by the earlier fix:
=== falseworks forrun.ts(wheredeliveryRequestedis alwaysboolean), but fails forrun-executor.ts(where it's?: booleanand can beundefined).Files changed
src/cron/isolated-agent/channel-output-policy.ts: +1/-1src/cron/isolated-agent/channel-output-policy.test.ts: +10 (undefined + missing opts cases)Related
Fixes #90664
Context: @TurboTheTurtle confirmed the basic
=== falsefix was already on main but missed theundefinededge case inrun-executor.ts(June 13 comment).Real behavior proof
resolveCronChannelOutputPolicyreturnsfalsewhendeliveryRequestedisundefinedor not passed —=== falseonly matches explicitfalse, but?: booleanmeansundefinedis a real runtime value inrun-executor.tsnode --import tsxfalse,undefined, and missing opts all correctly returntrue— the rescue path inresolveCronPayloadOutcomeis no longer blocked for--no-delivercron whendeliveryRequestedcomes throughrun-executor.tsasundefined. Explicittrue(delivery requested) still correctlys returnsfalse.--no-delivercron run with a real agent producing recoverable tool warnings via therun-executor.tspath; the function-level edge case is verified through direct import🤖 Generated with Claude Code