Skip to content

[Bug]: Cron agentTurn jobs hang at model-call-started — isolated and persistent sessions, all providers, all settings #96160

Description

@boa901012-droid

Bug type

Behavior bug (model call hangs indefinitely in cron agentTurn path)

Summary

On OpenClaw 2026.6.9 (c645ec4), isolated agentTurn cron jobs consistently fail with cron: job execution timed out (last phase: model-call-started) at the configured timeout boundary. Chat sessions (main session) using the same models have zero failures over months of daily use.

Environment

  • OpenClaw 2026.6.9 (c645ec4)
  • macOS 26 (Darwin 25.3.0 arm64)
  • Models tested: deepseek/deepseek-v4-flash, dmxapi-cn/deepseek-v4-flash, dmxapi-cn/qwen3.5-flash
  • Gateway restarted multiple times during testing window

Steps to reproduce

  1. Create an isolated cron job with sessionTarget: "isolated" and kind: "agentTurn"
  2. Use deepseek/deepseek-v4-flash as model, timeoutSeconds: 360
  3. Set a moderately long prompt (1000+ tokens)
  4. Trigger via cron run --force
  5. Observe: job times out at exactly timeoutSeconds with model-call-started phase

Observed behavior — 10 consecutive failures across all variables

Test Provider Thinking lightContext sessionTarget Timeout Result
#5 deepseek (direct) off true isolated 360s ❌ model-call-started
#6 deepseek (direct) off true isolated 180s ❌ model-call-started
#7 dmxapi-cn off true isolated 360s ❌ model-call-started
#8 dmxapi-cn low true isolated 360s ❌ model-call-started
#9 dmxapi-cn low false isolated 360s ❌ model-call-started
#10 dmxapi-cn low true isolated 60s* ❌ model-call-started
#11 dmxapi-cn low true session:xxx 360s ❌ model-call-started

* Test #10 used a minimal prompt ("just call sessions_spawn") — even a trivial single-action model call hangs.

Key findings:

  • Changing provider (deepseek direct → dmxapi-cn proxy) → no effect
  • Changing thinking level (off → low) → no effect
  • Disabling lightContext → no effect
  • Changing sessionTarget (isolated → persistent named session) → no effect
  • Reducing task to single sessions_spawn call → no effect
  • Gateway restart → no effect

Contrast: chat sessions work perfectly

The same model (deepseek-v4-flash) has been used in daily chat with 100% success rate over months. Not a single model-call-started timeout in chat.

Fallback mechanism also broken in this path

When the primary model hangs at model-call-started, configured fallback models never trigger. The cron-level timeout kills the entire run before the model-call layer can engage fallback logic.

Why this matters

  • Cron is completely unusable for any agentTurn work on this version
  • Users have no way to differentiate between "API is slow" vs "cron is broken"
  • Raising timeoutSeconds is a red herring — the model call never actually starts
  • The diagnostic message model-call-started is misleading; it suggests the call was initiated when it may not have been dispatched at all

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.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.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions