Skip to content

Isolated cron agentTurn ignores model override and still executes with agent default model #61879

@gjamsue

Description

@gjamsue

Summary

When creating an isolated cron job with an explicit model override like --model "ollama/gemma3:12b", the cron job metadata correctly shows the overridden model, but the actual run still executes with the agent’s default model (in this case gpt-5.4 / openai-codex).

This makes it impossible to reliably move lightweight status/report cron jobs to a local model, even though the CLI and payload schema indicate model override support.

Expected behavior

For an isolated cron with:

  • payload.kind = "agentTurn"
  • sessionTarget = "isolated"
  • payload.model = "ollama/gemma3:12b"

the actual run should execute with:

  • model: ollama/gemma3:12b

Actual behavior

The cron job metadata shows:

  • model: ollama/gemma3:12b

but the actual run history shows:

  • model: gpt-5.4
  • provider: openai-codex

So the override appears to be accepted at config/metadata level, but ignored at execution time.

Reproduction steps

  1. Create a new isolated cron job for an agentTurn payload:
openclaw cron add \
  --name "coding-agent-status-report-20m-local" \
  --agent coding \
  --every 20m \
  --session isolated \
  --message "..." \
  --light-context \
  --announce \
  --channel telegram \
  --to 8261811945 \
  --timeout-seconds 600 \
  --model "ollama/gemma3:12b"
  1. Verify the cron metadata shows the override:
  • model: ollama/gemma3:12b
  1. Trigger it manually:
openclaw cron run <job-id>
  1. Inspect run history:
openclaw cron runs --id <job-id> --limit 1 --expect-final
  1. Observe the run result shows execution with:
  • model: gpt-5.4
  • provider: openai-codex

instead of the requested local model.

Additional verification

The issue is not with Ollama itself.

Direct local model test works:

ollama run gemma3:12b "用中文简短回复:本地模型联通测试成功。只输出这一句。"

This returns successfully, confirming:

  • Ollama is reachable
  • gemma3:12b is installed
  • local inference works

So the problem is specifically in the OpenClaw cron → isolated agentTurn execution path.

Observed scope

Affected setup:

  • isolated cron jobs
  • payload kind: agentTurn
  • explicit --model override
  • actual execution still uses agent default model

This was reproduced even after:

  • deleting the old cron jobs entirely
  • recreating new cron jobs from scratch
  • verifying the new cron metadata had the correct local model

Likely issue

Possible bug/limitation in the execution path where:

  • cron payload stores the model
  • but the isolated agentTurn run resolves to the agent default model instead of honoring payload.model

Why this matters

This prevents routing lightweight cron/report jobs to local models, which is important for:

  • cost control
  • reducing unnecessary cloud model usage
  • using strong cloud models only for actual coding/execution tasks
  • using local models for frequent summary/status jobs

Example affected use case

Two high-frequency status cron jobs intended to use local model:

  • coding status report
  • customer-support-bot status report

Both were recreated fresh with:

  • model: ollama/gemma3:12b

but actual execution still used:

  • gpt-5.4

Requested fix

Ensure that for:

  • sessionTarget = isolated
  • payload.kind = agentTurn
  • payload.model is present

the runtime actually executes with payload.model instead of silently falling back to the agent default model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions