feat: allow spawn_agent model and reasoning effort override - #27385
Conversation
…erride Adds optional model_config_id and reasoning_effort arguments to spawn_agent for general and explore subagents. Explicit selections win over personal and deployment subagent overrides but still require an enabled config, an enabled provider, and usable owner credentials; unusable selections fail the tool call instead of falling back. Adds a list_subagent_models tool so agents can discover the enabled, credential-usable model configs and their selectable reasoning efforts. computer_use keeps its dedicated provider routing and rejects both arguments.
…bing Threads the explicit model selection into buildOptions so configured override resolution is skipped instead of resolved and discarded, caches provider keys per provider in list_subagent_models, and reuses chatprovider.IsValidReasoningEffort for effort validation.
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec01037d51
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35bc2e94ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
DanielleMaywood
left a comment
There was a problem hiding this comment.
Review of the frontend side of things
Adds explicit model selection to subagent spawning. A parent agent can now discover which chat model configs are usable and spawn a child subagent on a specific model and reasoning effort, instead of always inheriting the configured default chain. The transcript shows the selection on the spawn row.
Changes
list_subagent_modelschatd tool: returns the caller-usable model configs (UUID, display name, model, provider, context limit, default flag, selectable reasoning efforts). Hidden for delegated child chats, same gating asspawn_agent.spawn_agentargs:model_config_id(UUID fromlist_subagent_models): the child chat is created on that config. Wins over personal and deployment overrides and over parent inheritance.reasoning_effort(none/minimal/low/medium/high/xhigh/max): pins the child's effort, clamped to the selected model's supported range at generation time. Independent ofmodel_config_id.type: "computer_use"rejects both args with a documented error; its model routing stays specialized.Spawned {title} with {model display name}, {effort} thinking. Effort display mirrors backend resolution (requested wins over the config default, clamped to the config max, omitted for models without effort settings). Spawns without explicit args are unchanged. Resolution uses the current model config catalog, so later admin edits to a config can shift historic labels.docs/ai-coder/agents/{architecture,index,models}.mdupdated to describe spawn-time model selection.No DB migrations, codersdk, or HTTP API changes; the selection reuses the existing
LastModelConfigIDpersistence and enabled-config resolver.Testing
coderd/x/chatd/subagent_internal_test.gocovering explicit selection, precedence over overrides, effort-only and combined spawns, all rejection paths,computer_userejection, andlist_subagent_modelsvisibility filtering.spawnModelDisplay.test.tsunit tests for the label resolver (default fallback, clamping, unknown config,none, out-of-scale values) plus Storybook play-function stories for the four label variants.go test ./coderd/x/chatd/green;make lint,pnpm lint, and formatting clean.develop.shdeployment: all six plan flows plus edge cases passed (children verified via DBlast_model_config_idand initial-message reasoning effort).