Who Picks the Subagent's Model in Codex? The Spawn Call Beats Your Configured Default, and Nothing Enforces an Allowlist
A user on a ChatGPT Plus plan reports that a parent session on one model, with three read-only subagents requested at high reasoning, ended up with all three subagents on a larger model, and that the five-hour allowance ran out in about four minutes.1 The report is one person’s, the maintainers had not replied when I read it, and the quota charges cannot be reconstructed from outside.1 What can be checked is the code path that decides a subagent’s model. This article reads that path in the openai/codex source at commit 4a7cc49 and says what it does and does not let you control. Nothing was run; I did not reproduce the incident, and I make no claim about why the parent model chose what it chose.2
What the report says
Issue #65766 describes codex-cli 0.172.0 with gpt-6-luna at maximum reasoning as the parent. The reporter says the local rollout files show three spawn_agent requests, each selecting gpt-6.2-astra with high reasoning effort, and that the children’s recorded turn context matches.1 The reporter’s allowance snapshots go from 0% to 100% across about four minutes, and the reporter states that the per-agent charges cannot be reconstructed and that the issue was not reproduced on 0.174.0.1 Two similar-looking reports, #64705 (closed) and #64983 (open), were flagged as possible duplicates by a bot; I did not read them in depth.3
The reporter’s own evidence matters for the question here: the model name appears in the spawn request itself. That points at the tool call, not at a silent server-side substitution.1 It is still the reporter’s reading of local files that I have not seen.
How the model for a child is decided
The function apply_requested_spawn_agent_model_overrides in codex-rs/core/src/agent/child_config.rs starts from a child config built from the parent’s current settings, so by default the child has the parent’s model and effort.4 It then applies, in this order:
- The
modelargument from the spawn call, if present. - Otherwise
agents.default_subagent_modelfrom your config, if set.45 - The same two-step rule separately for
reasoning_effort: the call’s value, elseagents.default_subagent_reasoning_effort.45
In the source, the first line of the function is requested_model.or(turn.config.agent_default_subagent_model).4 The config comment says the default applies “when the spawn call does not select one.”5 So a configured default is a fallback for calls that say nothing. It is not a ceiling.
If the call does name a model, the code looks it up in the list of available models that support the multi-agent backend and returns an “Unknown model” error with the available names if there is no match.4 Nothing in that function compares the chosen model with the parent’s, with a cost, or with a list you wrote. When a model is chosen and no effort is given, the child takes that model’s default effort; when both are given, the effort must be one the model supports.4
Roles are applied after this step. apply_spawn_agent_role can change the model through the role’s config file, and the code then only re-validates the reasoning effort for the new model.4 A role’s model is therefore a second way a child can end up on a model other than the parent’s, and one you control, since you write the role file.
What steers the model away from overriding
Two pieces of text in the tool definition, sent to the parent model, discourage overrides:
- Version 1 text: “Spawned agents inherit your current model by default. Omit
modelto use that preferred default; setmodelonly when an explicit override is needed.”6 - Version 2 text, used when a model catalog is placed in context: “Do not set the
modelfield unless the user explicitly asks for a different model.”6
The model parameter itself is described as “Model override for the new agent. Omit unless an explicit override is needed.”6 These are instructions to a model, not checks in code. The same file lists up to 16 picker-visible models, with their reasoning efforts, in the tool description, when the catalog is not in context, under the heading “Available model overrides (optional; inherited parent model is preferred)”.64 Whether a given parent model follows the guidance is outside what source reading can tell me, and the report is the only evidence I read of a case where it did not.
The switches that do exist
Three controls change what the parent is offered or what children start with:
[agents] default_subagent_modelanddefault_subagent_reasoning_effortset the fallback for calls that omit them.5 They do not stop a call from naming something else.expose_spawn_agent_model_overridesin the multi-agent v2 feature config: when false, the spawn tool is built without themodelandreasoning_effortparameters, and a test asserts those properties are absent along with the “Available model overrides” text.78 The built-in default istrue.9hide_spawn_agent_metadataremovesagent_type,modelandreasoning_effortfrom the version 1 tool in the same way.6
I did not trace which TOML table these feature settings are written under, so check config.schema.json before copying a key name. I also did not test whether removing the parameters is honoured end to end; the unit test covers the tool definition only.8 If it does, it is the nearest thing to enforcement: the parent cannot name a model it was never given a field for. A role file can still set one.
What is not in the code I read
The issue asks for an enforceable list of permitted models for delegated agents.1 I found no such setting in the child-config path, and one comment on the issue proposes tests for exactly that: a child request outside a permitted list rejected before the child starts, with the reason visible.10 That is the commenter’s proposal, not a feature. I also did not look for per-agent usage display, usage budgets or a pre-spawn cost warning outside this path, so I make no claim they are absent elsewhere.
Related changes in the same week address different limits. Pull requests #65897 and #65907 let you adjust subagent concurrency for the session and save approved limits as defaults; they cap how many children run, not which model they use.11
What to do today, given what the code shows
| If you want | What the source supports |
|---|---|
| Children to start on a cheaper model unless told otherwise | Set [agents] default_subagent_model; know that a spawn call can still override it45 |
| The parent unable to choose a child model | Turn off expose_spawn_agent_model_overrides (verify the key name in the schema); children then inherit, or use the configured default78 |
| A specific model for a specific kind of work | Define a role whose config file sets the model; you choose it, not the parent4 |
| To know what a child ran on | The reporter found the model in local rollout files; I did not check where else it shows1 |
| Early warning on allowance | Check usage before a fan-out of several children; the report shows high-effort children on a larger model can consume a window fast1 |
Limits of this article
This reads one commit of the source, the issue and its two comments. I did not run Codex, did not read the OpenAI documentation or the TOML reference, did not verify the issue’s usage numbers, and did not establish whether the escalation was the parent model’s choice, a configuration effect or a defect, which is what the reporter asked the maintainers to find out.1 Later commits may change any of this; the maintainers’ answer on the issue is the thing to wait for.
-
openai/codex issue #65766, “GPT-6 Luna MAX unexpectedly spawns three GPT-6.2 Astra HIGH subagents, exhausting 5-hour allowance in 4 minutes”, opened 4 December 2026; read 6 December 2026, open, two comments. All figures and the rollout-file evidence are the reporter’s. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
-
openai/codex at 4a7cc49,
mainon 6 December 2026. ↩ -
Comment by the repository’s duplicate-detection bot on #65766, 4 December 2026, listing #64705 (closed) and #64983 (open). ↩
-
codex-rs/core/src/agent/child_config.rs:prepare_agent_spawn_config,apply_requested_spawn_agent_model_overrides,find_spawn_agent_model_name,apply_spawn_agent_role,MAX_SPAWN_AGENT_MODEL_OVERRIDES. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 -
codex-rs/config/src/config_toml.rs:AgentsToml.default_subagent_modelanddefault_subagent_reasoning_effort; loaded incodex-rs/core/src/config/mod.rs. ↩ ↩2 ↩3 ↩4 ↩5 -
codex-rs/core/src/tools/handlers/multi_agents_spec.rs:SPAWN_AGENT_INHERITED_MODEL_GUIDANCE,_V2,SPAWN_AGENT_MODEL_OVERRIDE_DESCRIPTION,spawn_agent_models_description,create_spawn_agent_tool_v1and_v2. ↩ ↩2 ↩3 ↩4 ↩5 -
Same file:
create_spawn_agent_tool_v2removesmodelandreasoning_effortwhenexpose_spawn_agent_model_overridesis false. ↩ ↩2 -
codex-rs/core/src/tools/handlers/multi_agents_spec_tests.rs, the test assertingagent_type,model,reasoning_effortandservice_tierare absent from the tool. ↩ ↩2 ↩3 -
codex-rs/features/src/feature_configs.rs, the doc comment onexpose_spawn_agent_model_overrides; the built-in defaulttrueis set incodex-rs/core/src/config/mod.rs. ↩ -
Comment by DrPei12 on #65766, 5 December 2026, proposing admission tests for a child model outside a permitted policy. ↩
-
PR #65897, “Let users adjust subagent concurrency for the current session” and PR #65907, “Let users save approved subagent limits as defaults”; titles as listed in the repository history at 4a7cc49. ↩