openclaw - 💡(How to fix) Fix Cron jobs ignore payload.model and run on agent default model (Opus instead of GPT-5.4) [1 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#57997Fetched 2026-04-08 01:55:06
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Fix Action

Workaround

Disabled the most frequent cron (usage-sync-supabase) until this is fixed.

Code Example

"payload": {
  "kind": "agentTurn",
  "model": "openai-codex/gpt-5.4",
  ...
}

---

type: model_change → modelId: claude-opus-4-6 / provider: anthropic
RAW_BUFFERClick to expand / collapse

Bug Description

Cron jobs that specify payload.model in their configuration are ignoring that field and running on the agent's default model instead.

Expected Behavior

A cron job configured with:

"payload": {
  "kind": "agentTurn",
  "model": "openai-codex/gpt-5.4",
  ...
}

Should execute using openai-codex/gpt-5.4.

Actual Behavior

The cron job runs on anthropic/claude-opus-4-6 (the agent's defaults.model.primary), completely ignoring the payload.model field.

Impact

  • usage-sync-supabase cron runs every 30 minutes → 48 Opus sessions/day instead of GPT-5.4
  • Each session costs ~$0.14 in Opus (vs ~$0.001 in GPT-5.4)
  • Estimated daily waste: ~$6.70+ from this single cron alone
  • morning-briefing also affected (also specifies gpt-5.4 but runs on Opus)
  • Total daily cost impact likely $10-20+ across all cron jobs

Evidence

Session JSONL files from cron executions show:

type: model_change → modelId: claude-opus-4-6 / provider: anthropic

Despite the cron config clearly having model: openai-codex/gpt-5.4 in the payload.

Verified via:

  • openclaw cron list --json shows correct payload.model
  • Session transcripts show Opus being used
  • Anthropic Console logs confirm 38+ Opus requests from cron in a single day

Environment

  • OpenClaw: 2026.3.28 (f9b1079)
  • OS: macOS (Apple Silicon)
  • Agent config: agents.defaults.model.primary = anthropic/claude-opus-4-6

Workaround

Disabled the most frequent cron (usage-sync-supabase) until this is fixed.

extent analysis

Fix Plan

To resolve the issue of cron jobs ignoring the payload.model field, we need to update the cron job execution logic to prioritize the model specified in the payload over the agent's default model.

Step-by-Step Solution:

  1. Update the cron job execution function to check for the payload.model field and use it if present.
  2. Modify the agent configuration to ensure that the payload.model field is properly propagated to the execution environment.

Example Code Changes:

# Before
def execute_cron_job(cron_config):
    # Use the agent's default model
    model = agent_config['defaults']['model']['primary']
    # Execute the job using the default model
    execute_job(model, cron_config['payload'])

# After
def execute_cron_job(cron_config):
    # Check if the payload has a model specified
    if 'model' in cron_config['payload']:
        # Use the model from the payload
        model = cron_config['payload']['model']
    else:
        # Fall back to the agent's default model
        model = agent_config['defaults']['model']['primary']
    # Execute the job using the selected model
    execute_job(model, cron_config['payload'])

Verification

To verify that the fix worked, check the following:

  • The cron jobs are executing with the correct model (in this case, openai-codex/gpt-5.4).
  • The session JSONL files show the correct model ID and provider.
  • The Anthropic Console logs confirm that the correct model is being used.

Extra Tips

  • Ensure that the payload.model field is properly validated and sanitized to prevent potential security issues.
  • Consider adding logging and monitoring to track the models used by cron jobs and detect any potential issues.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING