openclaw - 💡(How to fix) Fix [Bug]: image_generate callbacks from failed isolated cron runs are routed to subsequent runs of the same job

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. Have the session terminate before receiving the image callback (e.g. due to a tool error or billing interruption).

Fix Action

Fix / Workaround

Additional information: Last known good: 2026.5.18. First known bad: 2026.5.22. Workaround: run the agent as a subagent with a different sessionKey (not sharing the cron jobId prefix). The 2026.5.22 changelog mentions image_generate now uses "separate session-backed background tasks with message-tool completion delivery" — this change appears to be the source of the regression.

Code Example

incomplete turn detected: stopReason=toolUse payloads=1
Session history seq 1: role=user, provenance.sourceTool=image_generate (inter-session callback), no prior cron prompt message visible
Run duration: ~130-138s across 5 consecutive failed runs
input_tokens=16-21 (anomalously low vs working runs: 33-52)
RAW_BUFFERClick to expand / collapse

Bug type: Regression (worked before, now fails)

Beta release blocker: No

Summary: After upgrading to 2026.5.22, when an isolated cron session calls image_generate and terminates before receiving the callback, the pending image is delivered as the first message of the next run of the same job, bypassing the cron prompt entirely.

Steps to reproduce:

  1. Create a cron job with sessionTarget: isolated and payload.kind: agentTurn.
  2. Inside the agent turn, call image_generate (background task).
  3. Have the session terminate before receiving the image callback (e.g. due to a tool error or billing interruption).
  4. Trigger the job again (manually or via schedule).
  5. Observe that the new run starts with the orphaned image_generate callback as its first user message instead of the cron prompt.

Expected behavior: Orphaned image_generate callbacks from a terminated session should be discarded or ignored. The new run should start with the cron's configured prompt as its first message, as it did in 2026.5.18.

Actual behavior: The new run receives the stale image as its first user message (seq: 1). The cron prompt is not delivered. The agent processes the image without context, sends it to unrelated channels, and fails with stopReason=toolUse. This cascades: each failed run leaves new orphaned callbacks that poison the next run.

OpenClaw version: 2026.5.22

OS: Ubuntu 24.04

Install method: npm global

Model: anthropic/claude-sonnet-4-6

Provider / routing chain: openclaw -> anthropic

Logs:

incomplete turn detected: stopReason=toolUse payloads=1
Session history seq 1: role=user, provenance.sourceTool=image_generate (inter-session callback), no prior cron prompt message visible
Run duration: ~130-138s across 5 consecutive failed runs
input_tokens=16-21 (anomalously low vs working runs: 33-52)

Impact and severity:

  • Affected: any isolated cron job that uses image_generate
  • Severity: High — blocks the job entirely and creates a self-perpetuating failure cascade
  • Frequency: 100% reproduction after the first failure (5/5 runs failed)
  • Consequence: cron never completes, orphaned images sent to wrong channels, manual intervention required

Additional information: Last known good: 2026.5.18. First known bad: 2026.5.22. Workaround: run the agent as a subagent with a different sessionKey (not sharing the cron jobId prefix). The 2026.5.22 changelog mentions image_generate now uses "separate session-backed background tasks with message-tool completion delivery" — this change appears to be the source of the regression.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING