openclaw - 💡(How to fix) Fix [Bug]: Cron job agentTurn model override to Google/Gemini failing, defaulting to Anthropic/Claude [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#51530Fetched 2026-04-08 01:09:58
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2

Hi team,

I'm experiencing an issue with cron jobs running on OpenClaw v2026.3.13.

Problem: When setting payload.kind: "agentTurn" jobs with model: "google/gemini-2.5-flash" in the payload, the jobs consistently execute using anthropic/claude-sonnet-4-6 instead of the specified Gemini model.

This appears to be a bug in the Gateway's model resolution or routing for agentTurn payloads in isolated cron sessions.

Root Cause

Hi team,

I'm experiencing an issue with cron jobs running on OpenClaw v2026.3.13.

Problem: When setting payload.kind: "agentTurn" jobs with model: "google/gemini-2.5-flash" in the payload, the jobs consistently execute using anthropic/claude-sonnet-4-6 instead of the specified Gemini model.

This appears to be a bug in the Gateway's model resolution or routing for agentTurn payloads in isolated cron sessions.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Hi team,

I'm experiencing an issue with cron jobs running on OpenClaw v2026.3.13.

Problem: When setting payload.kind: "agentTurn" jobs with model: "google/gemini-2.5-flash" in the payload, the jobs consistently execute using anthropic/claude-sonnet-4-6 instead of the specified Gemini model.

This appears to be a bug in the Gateway's model resolution or routing for agentTurn payloads in isolated cron sessions.

Steps to reproduce

Steps to reproduce: Ensure google/gemini-2.5-flash is correctly registered in ~/.openclaw/openclaw.json under models.providers.google.models. Create an isolated cron job with payload.kind: "agentTurn" and model: "google/gemini-2.5-flash": json { "name": "Test Gemini Cron", "schedule": { "kind": "at", "at": "2026-03-21T15:00:00Z" }, "sessionTarget": "isolated", "payload": { "kind": "agentTurn", "message": "Test message.", "model": "google/gemini-2.5-flash", "timeoutSeconds": 60 }, "delivery": { "mode": "announce", "channel": "telegram", "to": "<your_chat_id>" } }

Run the job and check openclaw cron runs --id <jobId>.

Expected behavior

Expected behavior: The job should execute using google/gemini-2.5-flash as specified in the payload.

Actual behavior

Actual behavior: The job executes using anthropic/claude-sonnet-4-6 and logs provider: anthropic and model: claude-sonnet-4-6 in the run history, despite the payload explicitly requesting Gemini.

OpenClaw version

2026.03.13

Operating system

Ubuntu

Install method

npm

Model

sonnet 4.6

Provider / routing chain

You → Telegram/Discord → OpenClaw Gateway (WSL2, LordClaw) → Gemini 2.5

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the issue with the cron job executing the wrong model, follow these steps:

  • Update the openclaw.json file to ensure the google/gemini-2.5-flash model is correctly registered under models.providers.google.models.
  • Modify the cron job payload to include the provider field explicitly:
{
  "name": "Test Gemini Cron",
  "schedule": { "kind": "at", "at": "2026-03-21T15:00:00Z" },
  "sessionTarget": "isolated",
  "payload": {
    "kind": "agentTurn",
    "message": "Test message.",
    "model": "google/gemini-2.5-flash",
    "provider": "google",
    "timeoutSeconds": 60
  },
  "delivery": { "mode": "announce", "channel": "telegram", "to": "<your_chat_id>" }
}
  • Verify that the OpenClaw Gateway is configured to route requests to the correct provider (Google) for the google/gemini-2.5-flash model.

Verification

To verify the fix, run the updated cron job and check the logs to ensure that the job executes using the google/gemini-2.5-flash model. You can do this by running openclaw cron runs --id <jobId> and checking the output for the correct model and provider.

Extra Tips

  • Ensure that the openclaw.json file is correctly formatted and that the google/gemini-2.5-flash model is registered under the correct provider.
  • If issues persist, check the OpenClaw Gateway logs for any errors or misconfigurations that may be causing the incorrect model to be used.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Expected behavior: The job should execute using google/gemini-2.5-flash as specified in the payload.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Cron job agentTurn model override to Google/Gemini failing, defaulting to Anthropic/Claude [2 comments, 3 participants]