Repository navigation
spawn_agent(model="gpt-5.4-mini") produces child thread metadata with model="gpt-5.4" #15177
Copy link
Copy link
Closed as duplicate
Closed as duplicate
Copy link
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appbugSomething isn't workingSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingIssues involving session (thread) management, resuming, forking, naming, archiving
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.317.21539 (1088)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.3.0 arm64 arm
What issue are you seeing?
## Summary
Codex subagents spawned with `model: "gpt-5.4-mini"` are later recorded in the child thread metadata as `model: "gpt-5.4"`.
This makes the child thread UI show `GPT-5.4`, even though the parent explicitly requested `gpt-5.4-mini`.
## Environment
- Product: Codex desktop app
- Version: `0.116.0-alpha.1`
- Date observed: `2026-03-19`
- Timezone: `America/New_York`
## Expected behavior
When the parent thread calls `spawn_agent` with:
```json
{
"model": "gpt-5.4-mini",
"reasoning_effort": "xhigh"
}the spawned child thread should preserve and display that same model in its persisted metadata and UI.
Actual behavior
The parent thread log shows the subagent was spawned with model: "gpt-5.4-mini", but the child thread’s persisted turn_context records model: "gpt-5.4".
What steps can reproduce the bug?
Minimal repro
- In Codex desktop, ask the parent agent to spawn a subagent with:
model: "gpt-5.4-mini"reasoning_effort: "xhigh"
- Open the spawned child thread
- Check the child thread’s displayed model and persisted session metadata
- Observe that the child thread is recorded as
gpt-5.4
Evidence
Parent thread spawn_agent call:
{
"agent_type": "explorer",
"fork_context": true,
"model": "gpt-5.4-mini",
"reasoning_effort": "xhigh",
"message": "Perform a bug-focused review..."
}Child thread persisted context:
{
"type": "turn_context",
"payload": {
"model": "gpt-5.4",
"collaboration_mode": {
"mode": "plan",
"settings": {
"model": "gpt-5.4",
"reasoning_effort": "xhigh"
}
}
}
}Notes
This proves that:
- the parent requested
gpt-5.4-mini - the child thread metadata was recorded as
gpt-5.4
It does not prove from logs alone whether inference actually ran on mini or was remapped before execution.
So the issue appears to be in one of:
spawn_agentmodel handling- child-thread metadata persistence
- UI provenance/display of spawned model
Impact
This makes it hard to trust or verify delegated model selection for:
- cost-sensitive fan-out reviews
- performance comparisons
- debugging subagent behavior differences
Suggested investigation
Please check whether:
spawn_agent.modelis being dropped or normalized during child-thread creation- child
turn_context.modelis defaulting to the parent model - the UI is reading thread-default model instead of actual spawned-run model provenance
```md
### Sanitized log excerpts
Parent session:
```json
{"type":"response_item","payload":{"type":"function_call","name":"spawn_agent","arguments":"{\"agent_type\":\"explorer\",\"fork_context\":true,\"model\":\"gpt-5.4-mini\",\"reasoning_effort\":\"xhigh\",\"message\":\"Perform a bug-focused review...\"}"}}
Child session:
{"type":"turn_context","payload":{"model":"gpt-5.4","collaboration_mode":{"mode":"plan","settings":{"model":"gpt-5.4","reasoning_effort":"xhigh"}}}}
### What is the expected behavior?
_No response_
### Additional information
When a parent thread spawns a subagent with an explicit model override like `model: "gpt-5.4-mini"` and `reasoning_effort: "xhigh"`, the spawned child thread should preserve that exact model in its persisted metadata and display it consistently in the UI.
Concretely, I expect:
- the child thread metadata to record `gpt-5.4-mini`
- the child thread UI/model picker to show `GPT-5.4-mini`
- no silent normalization or fallback to `gpt-5.4` unless Codex explicitly reports that fallback to the user
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appbugSomething isn't workingSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingIssues involving session (thread) management, resuming, forking, naming, archiving
Activity
github-actions commentedon Mar 19, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
jhste102lab commentedon Mar 27, 2026
I can still reproduce this on current
main(be5afc65d31728c11d67c589cebbc64a87979e74) in the CLI, not just in Desktop/VS Code.What I verified on March 27, 2026:
be5afc6codex execrepro that spawns exactly oneexplorerspawn_agentcall explicitly requested:agent_type: "explorer"model: "gpt-5.4-mini"reasoning_effort: "xhigh"But the persisted child session metadata still records the inherited/default model instead of the requested explorer override:
019d2d8c-eef0-7f03-baa3-6aa4605e3afe019d2d8d-2697-76d0-99fa-ac765ee8db15Observed in the logs:
Parent session:
{"type":"function_call","name":"spawn_agent","arguments":"{\"agent_type\":\"explorer\",\"fork_context\":false,\"model\":\"gpt-5.4-mini\",\"reasoning_effort\": \"xhigh\",...}"} Child session turn_context: { "model": "gpt-5.4", "collaboration_mode": { "mode": "default", "settings": { "model": "gpt-5.4", "reasoning_effort": "medium" } }, "effort": "medium" } So at minimum, this is still a child-session metadata / provenance bug on current main. I still cannot prove from logs alone whether actual inference ran on gpt-5.4-mini and only the metadata is wrong, or whether the override is being lost before execution. But the persisted child metadata is definitely inconsistent with the parent spawn_agent request. This seems broader than the original desktop-only framing, since I reproduced it in codex exec on a source build from current main. If useful, I can provide a more compact minimal repro prompt/command shape as well.ozan-s commentedon Apr 4, 2026
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:
ozan-s commentedon Apr 4, 2026
And here is the proposed fix:
Keesan12 commentedon May 18, 2026
Even if inference is actually running on mini, the metadata mismatch is still a real bug because cost and behavior analysis depend on the persisted receipt, not just the hidden execution path. I would treat this as provenance, not cosmetics: requested model, resolved model, displayed model, and actual execution model should either match or be shown explicitly when they do not. We ended up needing that exact split in MartinLoop once fan-out comparisons got more cost-sensitive.