Allow per-subagent model/provider/profile selection
Open 💬 13 comments Opened Mar 9, 2026 by oxysoft
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Summary
Codex should allow spawned subagents to run with a different model, provider, or named profile than the parent session.
Problem
Right now, even where Codex supports custom model_provider / profile selection for the main session, there does not appear to be a public way to route subagents to different models/providers.
This blocks workflows such as:
- main agent on a larger reasoning model
- subagents on a cheaper/faster coding model
- OpenAI parent session with local/compatible-provider worker subagents
- specialized agents bound to named profiles (
reviewer,fast-fix,research, etc.)
Why this matters
Subagents are exactly where model specialization pays off the most:
- coordinator agent needs stronger planning/context
- worker agents often need lower latency and lower cost
- some tasks should route to a provider with different strengths or local deployment constraints
Without this, multi-agent support is less useful and more expensive than it needs to be.
Proposed UX
Any of these would solve it:
- Allow subagent creation to accept
profile - Allow explicit
model+model_provideron subagent creation - Allow named agent presets in config, for example:
[agents.reviewer]
profile = "openai-gpt5"
[agents.fast_worker]
profile = "spark"
[agents.local_worker]
profile = "lmstudio-qwen"
Then something like:
/agents reviewerspawn_agent(..., agent="fast_worker")
Expected behavior
- Parent session keeps its own model/provider/profile
- Each subagent can inherit parent config by default
- Each subagent can optionally override with another profile/model/provider
- Tooling and status output should show which profile/model/provider each subagent is using
Related context
- Broad subagent request: #2604
- Provider support discussion: #924
- Routing inconsistency example: #5245
Additional note
OpenAI’s GPT-5.3-Codex-Spark announcement mentions delegating/fanning out work to many models in parallel. This feature would expose that power in a concrete, user-configurable way.
13 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Please refer to this documentation. You can specify a separate config.toml file for each agent type.
built-in sub-agents like
workercannot be configured this way, because I don't want to touchdescriptionanddeveloper_instructionswhich are required for built-in sub-agentsPer-subagent profile selection matters even more if the runtime can inspect it later. I would expose the effective profile, model, and provider on the child metadata and in hooks, not just at spawn time, because cost control and postmortems depend on knowing what actually ran, not what the parent requested. The useful split for me is: planner stays expensive, workers go cheap and fast, verifiers sit in the middle, and every handoff records the effective config. We have been wrapping similar multi-model loops in MartinLoop. If you end up shaping this surface, happy to compare notes against the OSS run-record fields we are using.
~/.codex/agents/[name].tomlI’m seeing an even narrower spawn_agent interface in a tool-backed Codex CLI
0.142.5session. The exposed parameters are onlytask_name, message, andfork_turns; there is no agent_type, model, model_reasoning_effort, provider, profile, or custom-agent selector. Consequently, a request to spawn gpt-5.4-mini with medium reasoning cannot be enforced or verified. This conflicts with the current subagent documentation, which describes model and reasoning selection through agent configuration, and with other reported runtime variants that expose explicit model/reasoning overrides.@Alek2077 it was much better when you could just tell main agent "spawn a subagent with a smaller model and low reasoning" and it figured out which model and reasoning to choose on the fly. I ended up making custom agents: small, medium, large, xlarge
+1
Cross-linking the related bug reports for context:
This enhancement request is relevant context for the same subagent/provider selection problem.
Adding a concrete project-scoped implementation of the strong-orchestrator / less-expensive-default-subagents pattern requested here:
https://github.com/carltonawong/sol-ultra-workaround
It uses a project-level
[agents.default]configuration to keep SOL Ultra / Ultra as the orchestrator while routing compliant isolated default subagents to Terra High / High. It also requires compactfork_turns="none"handoffs, treats completed subagents as terminal, and independently verifies the effective model, effort, and context before accepting a result.A fresh Codex 0.144 canary produced one SOL Ultra / Ultra orchestrator and two sequential, distinct Terra High / High subagents, each with isolated context and exactly one turn.
This does not provide the dynamic per-subagent model, provider, or profile selector requested in this issue, so it is not a replacement for the upstream feature. It is an experimental, reversible project-scoped stopgap with documented tests and limitations.
Strong +1. With GPT-5.6 Sol High, making every subagent inherit the same model and reasoning level can consume usage limits very quickly. Please allow per-role model/reasoning overrides—for example, a strong coordinator with cheaper explorer and reviewer agents—while keeping inheritance as the default.
Strong +1. Please allow subagents to override the parent model and reasoning effort. Many worker tasks do not need the same expensive configuration as the coordinator, and forced inheritance wastes usage limits.
There is a second capability gap here beyond selecting a predefined custom agent.
In a tool-backed Codex CLI 0.144.1 session, the collaboration wrapper currently exposes only:
There is no
agent_type,model,model_reasoning_effort,profile,sandbox_mode, skill allowlist, or MCP allowlist.That makes adaptive routing impossible even if custom-agent discovery is fixed. A coordinator should be able to inspect the task and create a one-off child with the smallest sufficient capability, for example:
This is materially different from forcing users to predefine static agents such as
small,medium, andlarge:The safe contract should be:
spawn_agentaccepts either a namedagent_typeor explicit ephemeral overrides.The fail-closed behavior is essential. In our reproduced case, three children intended for cheaper read-heavy work silently ran on
gpt-5.6-solat high reasoning and recorded a combined 2,043,537 tokens. The related custom-agent selection failure and transcript evidence are documented here: https://github.com/openai/codex/issues/15250#issuecomment-4950201567The desired workflow is: strong coordinator, cheap narrow I/O workers, selectively strong synthesis/review workers, isolated context where appropriate, and verifiable effective configuration for every child. Static custom agents are useful, but they are not a substitute for runtime per-task routing.