-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Cron isolated session false positive: tool-level error marks run as failed despite successful execution #91532
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug Description
When a cron job with
sessionTarget: "isolated"runs a long multi-turn session (70+ tool calls including exec, write, edit, wiki_apply) and completes successfully withstopReason: "stop", OpenClaw sometimes still marks the run asstatus: "error"with a generic error message.Steps to Reproduce
sessionTarget: "isolated",lightContext: truestopReason: "stop"status: "error"with:source: "tool" -> "LLM request failed"(first cron)source: "tool" -> "⚠️ ⏰ Cron failed"(second cron)Expected Behavior
Cron runs where the agent completed successfully (all tool calls returned without isError, model stopReason: "stop") should be marked as
status: "ok"and delivered normally.Actual Behavior
The run is marked as
status: "error"with:deliveryStatus: "not-delivered"deliveryError: "LLM request failed"/"⚠️ ⏰ Cron failed"consecutiveErrorscounter increments unnecessarilyEvidence
From the cron run diagnostics, two distinct failure modes were observed:
Mode A ("LLM request failed") - The exec tool returned
Command still running(non-blocking async), but the model side's request was aborted while waiting for the next tool result. The exec command had no explicittimeoutparameter, causing the model to wait indefinitely.Mode B ("Cron failed") - All tool calls completed successfully, the model finished with
stopReason: "stop", but the cron runner still flagged the run as failed. This appears to be a false positive in the post-run state check.Key evidence from the session history:
Diagnostics
The error diagnostics only show:
{ "entries": [ { "source": "tool", "severity": "error", "message": "LLM request failed." }, { "source": "agent-run", "severity": "error", "message": "LLM request failed." } ] }No tool name, no arguments, no underlying error message.
Key Issues
source: "tool"is reported, the diagnostics should include the tool name and the actual errorSuggested Fix
stopReason: "stop"and no tools returnedisError: true, the run should be considered successful.source: "tool"Environment
Related