Skip to content

feat(spawn): add --model flag for per-session model override#2117

Open
exuan wants to merge 1 commit into
AgentWrapper:mainfrom
exuan:feat/spawn-model-flag
Open

feat(spawn): add --model flag for per-session model override#2117
exuan wants to merge 1 commit into
AgentWrapper:mainfrom
exuan:feat/spawn-model-flag

Conversation

@exuan

@exuan exuan commented Jun 12, 2026

Copy link
Copy Markdown

What & why

ao spawn had no way to set the model for a single session — the model
was resolved only from project/role agentConfig.model, so every session
in a project shared one model. This adds a --model <name> flag to
ao spawn that overrides the model for that one spawn.

Resolution precedence: --model > role agentConfig.model > project
agentConfig.model. The agent plugins already forward the resolved
config.model to the underlying CLI as --model, so no plugin changes
are needed; this PR only wires the spawn flag through to
resolveAgentSelection.

Changes

  • --model <name> option on ao spawn
  • SessionSpawnConfig.model threaded to resolveAgentSelection({ spawnModelOverride })
  • spawnModelOverride takes precedence over role/project model in resolveAgentSelection

Backward compatibility

When --model is omitted, model resolution is unchanged.

How to test

ao spawn <issue> --agent claude-code --model claude-opus-4-7
ao spawn --help   # lists the new --model flag
  • pnpm build and pnpm typecheck pass for core and cli
  • ao spawn --help shows the --model flag

Issue

Addresses the per-session (ao spawn --model) part of #2116.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant