Skip to content

sessions_spawn model override not applied to sub-agents #6295

@richydeeee

Description

@richydeeee

Bug Description

The model parameter in sessions_spawn and the agents.defaults.subagents.model config setting are not being applied to spawned sub-agents. Sub-agents always inherit the main agent's model regardless of configuration.

Steps to Reproduce

  1. Configure sub-agent default model in clawdbot.json:
{
  "agents": {
    "defaults": {
      "subagents": {
        "model": {
          "primary": "openai-codex/gpt-4o",
          "fallbacks": ["openai/gpt-4o"]
        }
      }
    }
  }
}
  1. Spawn a sub-agent with explicit model override:
sessions_spawn(task="Test task", model="openai/gpt-4o")
  1. Tool returns { "modelApplied": true }

  2. Check the session transcript:

{"type":"model_change","provider":"anthropic","modelId":"claude-opus-4-5"}

Expected Behavior

Sub-agent should run on the specified model (openai/gpt-4o or openai-codex/gpt-4o).

Actual Behavior

Sub-agent runs on the main agent's model (anthropic/claude-opus-4-5) despite:

  • Config setting agents.defaults.subagents.model
  • Explicit model parameter in sessions_spawn
  • Tool returning modelApplied: true

Environment

  • Clawdbot version: 2026.1.24-3
  • OS: macOS (Darwin 25.2.0 arm64)
  • Main agent model: anthropic/claude-opus-4-5
  • Attempted sub-agent models: openai-codex/gpt-4o, openai/gpt-4o

Additional Context

Gateway logs show config is being detected and applied:

[reload] config change applied (dynamic reads: agents.defaults.subagents.model)

But the actual model used in sub-agent sessions is always the main agent's model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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