Skip to content

[Bug]: image_generate in isolated cron session closes turn before receiving callback — cron never completes #88001

Description

@nailujac

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When an isolated cron job calls image_generate, the agent turn closes before receiving the image callback. The image is delivered as a direct fallback to the channel, but the cron never continues past the image generation step — PR, Nirvana task, and notification are never created.

Steps to reproduce

  1. Create a cron job with sessionTarget: isolated and payload.kind: agentTurn.
  2. Inside the agent turn, call image_generate as part of a multi-step workflow (e.g. generate image → save to disk → git commit → open PR).
  3. Trigger the job (manually or via schedule).
  4. Observe that the turn ends with stopReason=toolUse immediately after calling image_generate, before the image callback arrives.
  5. The generated image is delivered as a direct fallback to the configured channel target, but the cron workflow does not resume after the image step.

Expected behavior

The agent turn should receive the image_generate completion callback and continue executing the remaining steps of the workflow, as it does in interactive chat sessions.

Actual behavior

The turn closes with stopReason=toolUse after calling image_generate. durationMs is ~140–180s (consistent with image generation time), output_tokens is ~5000–8000, and the summary is truncated mid-sentence at the image generation step. The image is delivered via direct fallback to the channel ("The generated image is ready."), but the cron never creates the PR, Nirvana task, or sends the completion notification. Reproduced on every run (5+).

OpenClaw version

2026.5.27

Operating system

Ubuntu 24.04

Install method

npm global

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Run summary (truncated): "Ahora redacto el artículo completo sobre depreciación de coches:"
durationMs: 181355
input_tokens: 18, output_tokens: 7646, total_tokens: 52631
status: ok (no error, but workflow incomplete)
Image delivered to channel as direct fallback (Telegram message "The generated image is ready.")
Session history: empty (messages: []) after run completes

Impact and severity

• Affected: any isolated cron job that uses image_generate as part of a multi-step workflow
• Severity: High — the cron reports status: ok but the workflow is silently incomplete; no PR, no task, no notification
• Frequency: 100% reproduction (5+ consecutive runs across versions 2026.5.22 and 2026.5.27)
• Consequence: automated content pipeline completely blocked; manual intervention required every run

Additional information

Related to #86459 (fixed in 5.27). That fix correctly prevents stale callbacks from poisoning subsequent runs. However, this is a separate issue: the agent turn itself closes before receiving the callback, so the workflow never resumes regardless of where the callback is routed. Last known good: 2026.5.18. The fix in #86459/PR #86529 addressed callback routing but not turn lifecycle in isolated cron sessions.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, 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.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions