Skip to content

spawn_agent should preserve explicit model overrides for explorer agents #15170

Closed

Description

@mengxin896

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

I verified locally that preserving runtime model state during role application fixes the explorer repro.

Activity

  1. added
    bug
    CLI
    tool-calls
    on Mar 19, 2026
  2. changed the title [-]spawn_agent explorer ignores explicit model override[/-] [+]spawn_agent should preserve explicit model overrides for explorer agents[/+] on Mar 19, 2026
  3. github-actions commented on Mar 19, 2026

    @github-actions
    Contributor
  4. mengxin896 commented on Mar 19, 2026

    @mengxin896
    Author

    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.

  5. jif-oai commented on Mar 19, 2026

    @jif-oai
    Contributor

    Good catch, fixing

  6. talhasarit commented on Mar 20, 2026

    @talhasarit

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugtool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions