spawn_agent should preserve explicit model overrides for explorer agents
Summary
spawn_agent can drop an explicit model override when agent_type="explorer" is used.
This is the current consolidated tracker for the subagent model/reasoning inheritance family also seen in #13204, #13849, and #14671. The reproduction here is specifically the built-in explorer role losing the caller's runtime model override.
Reproduction
Call spawn_agent with an explicit model override and the built-in explorer role:
{
"agent_type": "explorer",
"model": "gpt-5.2",
"message": "Reply with the exact model you are using, then stop."
}
Observed result: the child can fall back to the default model (gpt-5.4 in my test) instead of using the requested gpt-5.2.
Expected behavior
If the caller passes an explicit runtime model override to spawn_agent, that override should win unless the selected role explicitly sets its own model or reasoning fields.
Likely cause
apply_role_to_config(...) rebuilds config from layered TOML and drops the caller-selected runtime model state for roles that do not explicitly set it.
Related issues
- #13204
- #13849
- #14671
I verified locally that preserving runtime model state during role application fixes the explorer repro.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I applied a local fix that preserves the caller-selected runtime model state when applying the explorer role. After that change, subagent calls behave normally and respect the explicit model override.
Good catch, fixing
Thanks for the consolidated tracker here. We are still seeing this on Codex Desktop v0.116.0-alpha.10 as of March 20, 2026.
In a real run, the parent called
spawn_agentwithagent_type="explorer"andmodel="gpt-5.4-mini". The spawned child thread/session then recordedmodel="gpt-5.4"in its local sessionturn_contextinstead ofgpt-5.4-mini.So from the outside this still looks reproducible. We cannot tell from this alone whether it is only the metadata/UI issue tracked in #15177 or whether the explorer role is still actually dropping the runtime model override as described here, but in either case explicit subagent model overrides do not currently look trustworthy.
Could you please reopen this issue, or otherwise keep one issue in this family open until a fix is actually merged and released? Closing the tracker before the fix lands makes it hard for users to know whether
spawn_agent(..., model=...)is safe to rely on for explorer agents.