spawn_agent should preserve explicit model overrides for explorer agents

Resolved 💬 4 comments Opened Mar 19, 2026 by mengxin896 Closed Mar 19, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #14671
  • #13849

Powered by Codex Action

mengxin896 · 5 months ago

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.

jif-oai contributor · 5 months ago

Good catch, fixing

talhasarit · 5 months ago

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_agent with agent_type="explorer" and model="gpt-5.4-mini". The spawned child thread/session then recorded model="gpt-5.4" in its local session turn_context instead of gpt-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.