spawn_agent should preserve explicit model overrides for explorer agents

Resolved 💬 4 comments Opened Mar 19, 2026 by mengxin896 Closed Mar 19, 2026

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 ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗