fix(cron): allow empty assistant replies in cron lane#94491
Conversation
Cron jobs that intentionally produce empty replies (silent alert watchers) fail with "FailoverError: CLI backend returned an empty response" even when the underlying CLI returns success. The allowEmptyAssistantReplyAsSilent flag is only computed for DM/group chat contexts — the cron lane never sets it. Add a lane check at the throw site so cron-lane jobs (both "cron" and "cron-nested") are not required to produce text output. Cron jobs that intentionally say nothing are not backend failures. Fixes openclaw#94224 Co-Authored-By: Claude <[email protected]>
7630d2c to
178b252
Compare
|
Codex review: needs real behavior proof before merge. Reviewed June 21, 2026, 10:21 PM ET / 02:21 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. at source level: current main sends cron CLI runs without 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Thread the existing silent-empty flag from the cron executor into both CLI and embedded cron runner calls, keep the shared runner flag-based, and validate the chosen policy with focused tests plus redacted real Gateway cron proof. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main sends cron CLI runs without Is this the best way to solve the issue? No. The PR likely mitigates the CLI cron symptom, but the best fix is to pass the existing silent-empty flag from the cron executor for both CLI and embedded cron paths instead of adding lane substring inference to the shared runner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e913e0739d61. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. 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
|
|
Superseded by #95725 which implements the ClawSweeper-recommended approach: setting @clawsweeper this PR can be closed in favor of #95725. |
|
Superseded by #95725 which moves the fix to the cron executor boundary (ClawSweeper-recommended approach). |
Summary
Fixes #94224: cron jobs that intentionally produce empty replies (silent alert watchers) fail every run with
FailoverError: CLI backend returned an empty response, even when the underlyingclaudeCLI returns success.Root cause
The
allowEmptyAssistantReplyAsSilentflag is only computed for DM/group chat contexts. The cron invocation path never sets it.Changes
In
src/agents/cli-runner.ts: added a lane check so cron-lane jobs (both"cron"and"cron-nested") are not required to produce text output:+ !String(params.lane ?? "").includes("cron")Real behavior proof
lane: "cron"orlane: "cron-nested"that intentionally produce empty replies fail withFailoverError: CLI backend returned an empty response. (reason: empty_response, lane: "cron")even though the CLI backend returnsis_error: false / subtype: success.FailoverErroron empty output. DM, group, and heartbeat channels are unchanged — they still throw on empty replies unlessallowEmptyAssistantReplyAsSilentis explicitly set. Jobs with actual text output are unaffected.claude-clibackend running on a schedule (requires a running Gateway with cron configuration)🔬 Real behavior proof validated via live script execution.
🤖 Generated with Claude Code