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
- Set
agents.defaults.subagents.model: "anthropic/claude-sonnet-4-6" in openclaw.json
- Add a named agent to
agents.list[] with model.primary: "anthropic/claude-opus-4-6"
- Spawn it via
sessions_spawn(agentId: "research")
- 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.
Bug type
Behavior bug (incorrect output/state without crash)
Summary
When a named agent is defined in
agents.list[]withmodel.primaryset (e.g.,anthropic/claude-opus-4-6), andagents.defaults.subagents.modelis also set (e.g.,anthropic/claude-sonnet-4-6), the per-agent model config is ignored. The subagent always usesagents.defaults.subagents.modelinstead of its ownmodel.primary.Steps to reproduce
agents.defaults.subagents.model: "anthropic/claude-sonnet-4-6"in openclaw.jsonagents.list[]withmodel.primary: "anthropic/claude-opus-4-6"sessions_spawn(agentId: "research")subagents list- the session shows the defaults model, not the per-agent modelExpected behavior
Per-agent
model.primaryinagents.list[]should take precedence overagents.defaults.subagents.model. The more specific config should win.Actual behavior
agents.defaults.subagents.modelalways overridesagents.list[].model.primary. The only workaround is to pass an explicitmodelparameter on everysessions_spawncall.Evidence
Agent "research" configured with
model.primary: "anthropic/claude-opus-4-6". When spawned without explicit model parameter,subagents listshowsmodel: "anthropic/claude-sonnet-4-6"(the defaults value). Passingmodel: "anthropic/claude-opus-4-6"explicitly onsessions_spawnworks 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.