Skip to content

[Bug]: agents.list[].model.primary ignored - agents.defaults.subagents.model always wins #57993

@marcbal77

Description

@marcbal77

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When a named agent is defined in agents.list[] with model.primary set (e.g., anthropic/claude-opus-4-6), and agents.defaults.subagents.model is also set (e.g., anthropic/claude-sonnet-4-6), the per-agent model config is ignored. The subagent always uses agents.defaults.subagents.model instead of its own model.primary.

Steps to reproduce

  1. Set agents.defaults.subagents.model: "anthropic/claude-sonnet-4-6" in openclaw.json
  2. Add a named agent to agents.list[] with model.primary: "anthropic/claude-opus-4-6"
  3. Spawn it via sessions_spawn(agentId: "research")
  4. Check subagents list - the session shows the defaults model, not the per-agent model

Expected behavior

Per-agent model.primary in agents.list[] should take precedence over agents.defaults.subagents.model. The more specific config should win.

Actual behavior

agents.defaults.subagents.model always overrides agents.list[].model.primary. The only workaround is to pass an explicit model parameter on every sessions_spawn call.

Evidence

Agent "research" configured with model.primary: "anthropic/claude-opus-4-6". When spawned without explicit model parameter, subagents list shows model: "anthropic/claude-sonnet-4-6" (the defaults value). Passing model: "anthropic/claude-opus-4-6" explicitly on sessions_spawn works correctly.

OpenClaw version

2026.3.28

Operating system

macOS 15 (Darwin 25.4.0, arm64, Apple M4 Ultra)

Install method

npm global install

Impact and severity

Low-Medium - workaround exists (explicit model param), but violates principle of least surprise and makes per-agent model config useless.

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