openclaw - ✅(Solved) Fix [Bug] Cron job payload.model override ignored - always uses agent default [1 pull requests, 1 comments, 2 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#57367Fetched 2026-04-08 01:50:36
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
referenced ×3labeled ×2closed ×1commented ×1

Cron job isolated agentTurn payload.model is ignored. Setting model to dashscope/kimi-k2.5 causes job to always execute with agent default (zai/glm-5-turbo) instead. Tested with multiple jobs and configurations, 100% reproducible.

Root Cause

Cron job isolated agentTurn payload.model is ignored. Setting model to dashscope/kimi-k2.5 causes job to always execute with agent default (zai/glm-5-turbo) instead. Tested with multiple jobs and configurations, 100% reproducible.

PR fix notes

PR #57470: fix(cron): honour payload.model override even when not in allowlist

Description (problem / solution / changelog)

Summary

Fixes #57367

  • When a cron job's payload.model was set to a model not present in agents.defaults.models, the model was silently dropped and the agent default was used instead
  • This contradicts the documented priority: payload override (highest) > hook-specific defaults > agent config default
  • Now, when resolveAllowedModelRef rejects the model as "not allowed", we re-parse it via resolveModelRefFromString and apply it anyway, since payload.model is an explicit user configuration

Root cause

buildAllowedModelSet only includes models from agents.defaults.models keys + the default model + fallbacks. Models configured in providers but not in the allowlist were silently rejected, causing the cron executor to fall back to the agent default with only a warning log.

Changes

  • src/cron/isolated-agent/model-selection.ts: When payload.model is "not allowed", re-resolve it via resolveModelRefFromString instead of silently falling back
  • src/cron/isolated-agent/run.skill-filter.test.ts: Updated test to verify the new behaviour — payload.model is now applied even when not in the allowlist

Test plan

  • All 41 related unit tests pass (run.skill-filter, run.cron-model-override, model-formatting)
  • Manual test: configure a provider model not in agents.defaults.models, set it as payload.model on a cron job, verify it executes with the specified model

🤖 Generated with Claude Code

Changed files

  • src/cron/isolated-agent/model-selection.ts (modified, +28/-9)
  • src/cron/isolated-agent/run.skill-filter.test.ts (modified, +18/-16)

Code Example

Run evidence: status=ok model=glm-5-turbo provider=zai. jobs.json stores payload.model=dashscope/kimi-k2.5 correctly. Same across all 3 cron jobs.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Cron job isolated agentTurn payload.model is ignored. Setting model to dashscope/kimi-k2.5 causes job to always execute with agent default (zai/glm-5-turbo) instead. Tested with multiple jobs and configurations, 100% reproducible.

Steps to reproduce

  1. Configure dashscope provider with kimi-k2.5 in openclaw.json 2. Create isolated cron: openclaw cron add --name Test --session isolated --model dashscope/kimi-k2.5 3. Verify payload.model in jobs.json 4. Run: openclaw cron run 5. Check: openclaw cron runs 6. Result: model=glm-5-turbo (payload.model ignored)

Expected behavior

Per docs at /automation/cron-jobs, model resolution priority: 1) Job payload override (highest) 2) Hook-specific defaults 3) Agent config default. payload.model should take precedence. Expected: job executes with dashscope/kimi-k2.5.

Actual behavior

Job always executes with agent default (zai/glm-5-turbo), ignoring payload.model. Evidence from openclaw cron runs: model=glm-5-turbo, provider=zai. Tried --model via cron edit, --clear-agent, fresh jobs. Same result every time.

OpenClaw version

2026.3.28 (f9b1079)

Operating system

Windows 10 19045 (x64)

Install method

npm global install

Model

dashscope/kimi-k2.5 (payload) / zai/glm-5-turbo (actual)

Provider / routing chain

dashscope (coding.dashscope.aliyuncs.com) in openclaw.json models.providers

Additional provider/model setup details

dashscope provider config: baseUrl=coding.dashscope.aliyuncs.com/v1, api_key auth, models: kimi-k2.5, qwen3.5-plus, MiniMax-M2.5. Direct API test to dashscope returns HTTP 200 with valid response. Model field persists correctly in jobs.json storage.

Logs, screenshots, and evidence

Run evidence: status=ok model=glm-5-turbo provider=zai. jobs.json stores payload.model=dashscope/kimi-k2.5 correctly. Same across all 3 cron jobs.

Impact and severity

Affected: All users with multi-provider setups. Severity: blocks workflow, causes rate limits on default model. Frequency: always (100% reproducible). Consequence: extra cost on premium model, cron failures from rate limiting, inability to use cheaper models for scheduled tasks.

Additional information

Also tested with --clear-agent to remove agentId binding. dashscope works correctly as agent primary default model. Issue is specifically with payload.model override not being read by the cron execution engine.

extent analysis

Fix Plan

To resolve the issue of the cron job ignoring the payload.model and always executing with the agent default model, we need to modify the cron execution engine to prioritize the job payload override.

Here are the steps to fix the issue:

  • Update the openclaw cron execution engine to read the payload.model from the jobs.json file.
  • Modify the model resolution priority to correctly implement the expected behavior:
    1. Job payload override (highest)
    2. Hook-specific defaults
    3. Agent config default

Example code changes:

// In the cron execution engine
const job = getJobFromJson();
const model = job.payload.model || getHookDefaultModel() || getAgentDefaultModel();
  • Ensure that the payload.model is correctly stored in the jobs.json file when creating or editing a cron job.
  • Test the fix by running the cron job with the --model override and verifying that the correct model is used.

Verification

To verify that the fix worked, follow these steps:

  • Create a new cron job with the --model override.
  • Run the cron job and check the execution logs.
  • Verify that the correct model is used by checking the model field in the execution logs.

Extra Tips

  • Ensure that the openclaw version is updated to the latest version after applying the fix.
  • Test the fix with different models and providers to ensure that the issue is fully resolved.
  • Consider adding additional logging or debugging statements to help identify any future issues with the cron execution engine.

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

Per docs at /automation/cron-jobs, model resolution priority: 1) Job payload override (highest) 2) Hook-specific defaults 3) Agent config default. payload.model should take precedence. Expected: job executes with dashscope/kimi-k2.5.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING