Skip to content

Isolated cron sessions ignore model override (LiveSessionModelSwitchError) #57206

@KelTech-Services

Description

@KelTech-Services

Description

Isolated cron jobs with a model override fail with LiveSessionModelSwitchError when the cron model differs from the gateway's default agent model.

Environment

  • OpenClaw version: 2026.3.28 (f9b1079)
  • OS: macOS (Darwin 25.4.0 arm64)
  • Default model: anthropic/claude-opus-4-6

Steps to reproduce

  1. Set gateway default model to anthropic/claude-opus-4-6 in agents.defaults.model.primary
  2. Create an isolated cron job with a different model:
    openclaw cron add --name "test" --cron "0 * * * *" --session isolated --message "Hello" --model anthropic/claude-sonnet-4-6
  3. Run the job: openclaw cron run <id>
  4. Check runs: openclaw cron runs --id <id> --limit 1

Expected behavior

The isolated cron session should start with the model specified in the cron job payload (anthropic/claude-sonnet-4-6), since it's a fresh isolated session with no prior conversation.

Actual behavior

The isolated session initializes with the default agent model (anthropic/claude-opus-4-6), then the cron payload model override triggers a LiveSessionModelSwitchError:

LiveSessionModelSwitchError: Live session model switch requested: anthropic/claude-opus-4-6

The error message references the default model, suggesting the session is initialized with one model and then the cron system tries to apply the override as a model switch (which is blocked).

Workaround

Set the cron job model to match the gateway default model. This defeats the purpose of the model override feature for cost optimization on routine cron tasks.

Additional context

  • This affects all isolated cron jobs, including those with --light-context
  • Jobs that previously worked with model=sonnet before the 2026.3.28 update now fail
  • sessionTarget: main + systemEvent payload jobs are unaffected (they don't set a 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