Skip to content

Cron jobs stall during AI model calls (model_call:stream_progress never completes) #91892

Description

@luciaski

Environment

  • OpenClaw 2026.6.5
  • OS: Linux 6.17.0-35-generic (x64, Ubuntu)
  • Node: v24.16.0
  • Model: deepseek/deepseek-v4-flash
  • Channel: Telegram (direct DM)
  • Gateway mode: local

Bug 1 — sessionTarget: "main" with payload.kind: "systemEvent" silently does nothing

The cron job is created successfully (gateway logs [gateway] cron: job created). At the scheduled time, the job is never executed — no systemEvent is injected into the main session. No error in any log, no user-visible failure message. The job does not appear in cron: list after its execution window.

Bug 2 — sessionTarget: "isolated" stalls during AI model calls (model_call)

The cron job starts, an isolated session is created. The session gets stuck in state=processing with activeWorkKind=model_call. Diagnostic logs show:

classification=stalled_agent_run
reason=active_work_without_progress
lastProgressAge=135s → 165s → 195s (keeps increasing)
recovery=none

The delivery announce is never sent to Telegram. The agent never produces any output — it remains in model_call:stream_progress forever.

Bug 3 — cron: wake with mode: "now" reports success but fails

The tool API returns { "ok": true }, but the gateway sends a user-visible error message: ⚠️ ⏰ Cron: now failed. No detailed error in the logs.

What does work (workaround)

Cron isolated that runs deterministic Python scripts (no AI model calls) works perfectly. Delivery announce to Telegram is delivered successfully. Example: python3 daily_summary.py (calendar + tasks fetch, no model calls) completed in ~2s.

Relevant logs

Gateway journal:

Jun 10 08:34:08 luciano-X870 node[164032]: [gateway] cron: job created

Diagnostic (repeated every ~30s while stalled):

Jun 10 09:02:16 luciano-X870 node[164032]: [diagnostic] stalled session:
  sessionId=f3d3e8bd-...
  sessionKey=agent:main:cron:<id>:run:<id>
  state=processing
  age=166s
  queueDepth=1
  reason=active_work_without_progress
  classification=stalled_agent_run
  activeWorkKind=model_call
  lastProgress=model_call:stream_progress
  lastProgressAge=165s
  recovery=none

cron run --force output:

{
  "ok": true,
  "enqueued": true,
  "runId": "manual:<id>:<ts>:1"
}

Then it also stalls the same way.

Expected behavior

  • Cron with sessionTarget: "main" + systemEvent should inject the event into the main session
  • Cron with sessionTarget: "isolated" should be able to make AI model calls and complete normally
  • cron: wake with mode: "now" should either work or return a clear error
  • Stalled sessions should have automatic recovery or timeout

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper 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.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions