spawn_agent ignores requested gpt-5.4-mini model and launches subagent as gpt-5.4
What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Business
Which model were you using?
gpt-5.4, gpt-5.4-mini
What platform is your computer?
linux
What terminal emulator and version are you using (if applicable)?
JetBrains-JediTerm
What issue are you seeing?
When spawn_agent is called with model: "gpt-5.4-mini", Codex TUI 0.118.0 spawns the subagent as gpt-5.4 instead. The parent session logs show the requested model was gpt-5.4-mini, but collab_agent_spawn_end, the child session_meta, and the child turn_context all report gpt-5.4. This makes subagent model selection unreliable and can silently increase cost.
What steps can reproduce the bug?
- Start a Codex TUI session on gpt-5.4.
- Call spawn_agent with:
- agent_type: "explorer"
- model: "gpt-5.4-mini"
- reasoning_effort: "low"
- fork_context: false
- Inspect the resulting collab_agent_spawn_end event in the parent session.
- Open the spawned subagent session and inspect session_meta or turn_context.
Observed result: the subagent is reported and launched as gpt-5.4, not gpt-5.4-mini.
What is the expected behavior?
The spawned subagent should honor the model passed to spawn_agent. In this case, a request with model: "gpt-5.4-mini" should create and run the subagent as gpt-5.4-mini, and that same model should appear in collab_agent_spawn_end, the child session_meta, and the child turn_context.
Additional information
Parent session evidence shows the tool call arguments included model: "gpt-5.4-mini", but the subsequent collab_agent_spawn_end event reported model: "gpt-5.4". The spawned child session then also recorded model: "gpt-5.4" in both session_meta and turn_context.
I also checked the local installation and this does not look like a prompt-layer issue:
- Codex CLI version: 0.118.0
- The local models_cache.json includes gpt-5.4-mini
- Runtime logs show get_model_info{model="gpt-5.4-mini"}, so the model is recognized
- The mismatch appears specifically during subagent creation
This suggests the requested subagent model is being ignored or overwritten during orchestration, possibly falling back to the parent session model. The impact is that workflows relying on cheaper delegated agents can silently run on a more expensive model.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I'm also seeing sub-agents ignore the model I request. When I spawn with model: "gpt-5.4-mini", the agent runs on the parent's model ("gpt-5.4") instead.
This only happens with the "explorer" agent type. The "explorer" role has an associated config file (explorer.toml) that triggers a full config rebuild during spawn. That rebuild preserves model_provider but not model, so the requested model is lost and falls back to the parent session's model. The "default" role has no config file, so it skips the rebuild entirely and respects the model you specify.
Workaround: Use "default" as the agent type instead of "explorer". The model selection will then work as expected.
Here is the proof:
Here is the proposed fix:
I can still reproduce this locally, and in my case it looks like more than just metadata/UI drift.
Environment:
gpt-5.4Minimal repro:
agent_type: "explorer"model: "gpt-5.4-mini"reasoning_effort: "medium"fork_context: falseRun exactly one trivial command: sleep 5. Then report only done.Observed TUI:
Spawned Euclid [explorer] (gpt-5.4 medium)Observed local runtime logs (
codex-tui.log):thread_spawn ... model=gpt-5.4get_model_info{model="gpt-5.4"}turn ... model=gpt-5.4Child thread id from this repro:
019d68b7-81f6-7b43-be8b-4f504ef496d8This makes it look like the explicit
gpt-5.4-minirequest is not merely displayed incorrectly; the spawned explorer thread appears to actually initialize and execute asgpt-5.4.That matches the theory above that the explorer role config rebuild is wiping the requested model and falling back to the parent model.
Also confirmed from the same local logs:
model=gpt-5.4-miniImpact:
gpt-5.4 medium, users are likely paying for fullgpt-5.4even though they explicitly requestedgpt-5.4-miniI attached:
log-excerpt.txt
tui-evidence.txt
bump, this bug prevents Codex being an option in heavy token consuming environment (typical for any mid/large size company).
I can reproduce a related model-proof/model-routing failure on a newer Codex build, with 5.3 models rather than only 5.4-mini.
Environment:
0.128.0-alpha.1gpt-5.5highgpt-5.3-codexandgpt-5.3-codex-sparkObserved behavior:
gpt-5.5) rather than proving the requestedgpt-5.3-codexorgpt-5.3-codex-sparkroute.codex exec --model gpt-5.3-codex-spark --jsonprobe can request the Spark route, but final generated text still cannot directly observe the actual runtime model. In other words, final prose is not reliable model identity proof.Expected behavior:
Impact:
This looks related to the same class of issue tracked here: requested subagent model selection is ignored, overwritten, or not provable after orchestration.