Skip to content

Cron fallback model works in normal session but LLM request fails when triggered via cron #97335

Closed as not planned

Description

@Suidge

Describe the Bug

When a cron job is configured with a primary model (e.g. volcengine-plan/ark-code-latest) and a fallback model (deepseek/deepseek-v4-flash), the cron job fails with "LLM request failed" even when:

  1. The primary model fails (e.g. due to rate limiting on the provider side)
  2. The runtime successfully falls back to the fallback model
  3. The same fallback model works perfectly fine in a normal interactive session

Steps to Reproduce

  1. Create an isolated agentTurn cron job:
    • Primary model: volcengine-plan/ark-code-latest
    • Fallback: deepseek/deepseek-v4-flash
    • Timeout: 600 seconds
  2. Let the primary model fail (e.g. rate limit triggered)
  3. Observe that the runtime falls back to deepseek/deepseek-v4-flash (confirmed in run logs: provider=deepseek, model=deepseek-v4-flash)
  4. The cron session shows the model is actually running and making progress (multiple tool calls succeed)
  5. Then the session is aborted mid-execution with "Request was aborted" error, long before the timeout

Evidence

Cron run log (last run before fix):

model: "deepseek-v4-flash"
provider: "deepseek"
usage: { input_tokens: 42075, output_tokens: 1370, total_tokens: 566837 }
durationMs: 401442  // ran for ~6.7 minutes, well within the 600s timeout
error: "LLM request failed."

Session history shows the model was actively working (4-5 tool calls completed successfully), then abruptly terminated:

role: assistant, stopReason: "toolUse"  ← tool call made successfully
...
role: assistant, stopReason: "aborted"
errorMessage: "Request was aborted"

Verification:

  • The same fallback model (deepseek/deepseek-v4-flash) was then set as the primary model on the same cron job, with no other configuration changes
  • The cron job succeeded immediately (~120 seconds, delivered successfully)
  • The model works normally in interactive sessions (this conversation is running on it)

Expected Behavior

When a cron job falls back to a fallback model, and that model responds successfully, the cron job should complete normally—not abort mid-execution.

Actual Behavior

The cron runtime aborts the request ("Request was aborted") even though the fallback model is responding and producing valid tool calls. The abort happens after several successful model turns.

Additional Context

  • OpenClaw version: 2026.6.10
  • Runtime: isolated session (sessionTarget: "isolated")
  • Cron type: agentTurn with lightContext: true
  • The issue is specifically not about model availability — the fallback model was accessible and working; the cron runtime itself aborted the session

Workaround

Setting the same model (deepseek/deepseek-v4-flash) as the primary model (removing the fallback chain) resolves the issue immediately. The problem appears to be in how the runtime manages session lifecycle when switching to fallback models.

Activity

  1. clawsweeper commented on Jun 28, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: the report documents fallback execution followed by cancellation on an official release, and neither a matching fix nor a shared cause with the linked reports is established.

    Reproducibility: no. high-confidence current-main reproduction is established: the historical report demonstrates fallback progress followed by abort, but lacks the final progress timestamps and cancellation reason; no runtime reproduction was attempted during this read-only review.

    Next step
    Obtain a redacted current-version cron trace showing effective timeouts, fallback transitions, the last model/tool progress event, and the final cancellation reason before selecting a repair.

    Review details

    Best possible solution:

    Identify the cancellation owner and repair any premature abort while preserving legitimate job and provider liveness deadlines.

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

    No high-confidence current-main reproduction is established: the historical report demonstrates fallback progress followed by abort, but lacks the final progress timestamps and cancellation reason; no runtime reproduction was attempted during this read-only review.

    Is this the best way to solve the issue?

    Removing the cron idle watchdog is not justified by these excerpts; first distinguish a silent provider interval from cancellation of an actively progressing fallback.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The available trace does not distinguish job cancellation, provider timeout, idle expiry, model-progress expiry, or lifecycle interruption.

    Codex review notes: model internal, reasoning medium; reviewed against 395cc8de7d6c.

    Label changes

    Label changes:

    • add clawsweeper:needs-info: Current issue advisory state selects this label.

    Label justifications:

    • P2: The reported scheduled-run failure has a working primary-model workaround and no established current widespread regression.
    • impact:auth-provider: The failure occurs during execution on a configured fallback provider.
    Evidence reviewed

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 16, 2026, 1:48 AM ET / 05:48 UTC.

  2. added
    P2Normal backlog priority with limited blast radius.
    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: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.
    on Jun 28, 2026
  3. Ayushdevo commented on Jun 28, 2026

    @Ayushdevo
    Contributor

    Hi! I'd love to help fix this issue. As clawsweeper noted, the 600s explicit timeout is being overridden by the 60s CRON_LLM_IDLE_TIMEOUT_MS during fallback. Before I open a PR, what is the preferred product decision here? Should the idle timeout be skipped entirely if a fallback model is actively progressing, or should the fallback inherit the remaining time of the parent job's 600s timeout?

  4. openclaw-barnacle commented on Jul 13, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. removed
    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.
    on Jul 13, 2026
  6. 42 remaining items

  7. openclaw-barnacle commented on Oct 9, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  8. removed
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    on Oct 9, 2026
  9. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Oct 16, 2026
  10. openclaw-barnacle commented on Oct 23, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale after 7 days without qualifying human activity.
    Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
    A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

  11. steipete commented on Oct 24, 2026

    @steipete
    Contributor

    Thanks for filing this. We're closing older issues that no longer look actionable on current main.

    The report lacks the cancellation reason and couldn't be reproduced on current main. The DeepSeek cron stall is tracked in #121953; please add a current-release trace there if this is the same thing.

    OpenClaw has changed a lot since this was filed. If this still affects you on the latest release, please open a fresh issue with your version and repro steps (feel free to link back here).

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

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions