Skip to content

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

Closed

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

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    The reported indefinite isolated-cron stream stall, main-session event loss, and wake acknowledgement interpretation are addressed by current main code and documentation; the narrower DeepSeek latency/retry report remains separately tracked.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the finite cron-stream guard and explicit queue-acknowledgement contract; investigate the distinct DeepSeek prefix latency/retry behavior in #121953.

    Do we have a high-confidence way to reproduce the issue?

    No high-confidence current-main reproduction remains: the inspected isolated-run path has a finite watchdog, and the main-session path has composed real-heartbeat coverage. This read-only review did not execute a provider-backed run.

    Is this the best way to solve the issue?

    Yes for the reported no-recovery failure: a bounded stream watchdog at the embedded-runner owner is the maintainable repair, while a wake response correctly reports queue acceptance rather than asynchronous completion.

    Security review:

    Security review: No proposed patch is under review.

    AGENTS.md: found and applied where relevant.

    What I checked:

    Likely related people:

    • Ayaan Zaidi: Authored the three July liveness/watchdog repair commits recorded for the isolated-run failure class. (role: runtime repair author; confidence: high; commits: 215be4e4ee20, 048f2096d247, e4949996d1eb; files: src/agents/embedded-agent-runner/run/llm-idle-timeout.ts, src/agents/embedded-agent-runner/run/llm-idle-timeout.test.ts)
    • Peter Steinberger: Current shallow-history blame attributes the inspected cron, watchdog, and documentation lines to the latest available source boundary; earlier provenance is incomplete locally. (role: recent area contributor; confidence: low; commits: 30968ee068ce; files: src/cron/service/timer-execution.ts, src/cron/service/wake.ts, docs/automation/cron-jobs.md)

    Codex review notes: model internal, reasoning high; reviewed against d47a684a37c9; fix evidence: commit 69913572f4a8, main fix timestamp 2026-08-29T00:15:50-07:00.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for 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.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 10, 2026
  3. FBfvis commented on Jul 1, 2026

    @FBfvis

    I am coming from #98647, which was closed as a duplicate of this issue.

    I can confirm that this still reproduces on OpenClaw app version v2026.6.11.

    My environment:

    • Deployment: Tencent Cloud Shanghai
    • Channel: WeChat + WebUI
    • Cron mode: isolated session
    • Model provider: DeepSeek-compatible provider
    • Model: DeepSeek v4-pro
    • lightContext: false

    Observed behavior:

    • First run of an evening report cron stalled at model_call:stream_progress
    • It timed out after around 385 seconds
    • Automatic retry succeeded in around 153 seconds
    • The final result was delivered to WeChat successfully on retry

    This suggests the full chain is not completely broken, but DeepSeek isolated cron streaming is unstable or intermittently stalls. The retry path can recover, but the first run may still hang for several minutes before timeout.

    The same DeepSeek provider works normally in the main chat session.

  4. 42 remaining items

  5. added
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for 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:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    P2Normal backlog priority with limited blast radius.
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions