Add global subagent runtime defaults for model, provider, and reasoning

Resolved 💬 2 comments Opened Jun 6, 2026 by bakaburg1 Closed Jul 16, 2026
💡 Likely answer: A maintainer (jif-oai, contributor) responded on this thread — see the highlighted reply below.

Problem

Subagents often do cheaper parallel work: exploration, log inspection, scans, test triage, and summarization. I want the main agent to use a strong model, but default subagents to a cheaper/faster model, a different provider, or even a local model to reduce cost, latency, and quota usage.

Today this seems to require per-agent TOML files under ~/.codex/agents/. That mixes runtime policy with agent definition: changing only model, model_provider, or model_reasoning_effort can force users into redefining agent metadata/instructions such as developer_instructions.

Proposal

Support global subagent runtime defaults in ~/.codex/config.toml:

[subagents]
model = "gpt-5.4-mini"
model_provider = "azure"
model_reasoning_effort = "low"

These should apply to spawned subagents by default and be overridable by individual agent TOML files.

Suggested precedence:

  1. Explicit spawn override
  2. Matching agent TOML
  3. Global [subagents] defaults
  4. Parent session / built-in defaults

This separates cost/control policy from behavioral customization. Users could keep built-in subagent instructions intact while routing subagents to cheaper hosted providers or local models by default.

---

Drafted by Codex and reviewed by me before submission.

View original on GitHub ↗

2 Comments

Necmttn · 2 months ago

Runtime defaults should be persisted on each child session after resolution.

Store requested model/provider/reasoning, resolved model/provider/reasoning, whether the value was inherited or overridden, and the policy source. Resume and cost views can then distinguish defaulted cheap subagent from explicit expensive child, which matters for quota and routing analysis.

---

_Generated with ax._

jif-oai contributor · 1 month ago

Landing in the next release