Model-aware task delegation for subagents
Hi and welcome back!
Interesting idea! I believe this is partially doable already and requires some custom settings.
The official Codex docs do not describe automatic parsing of inline task metadata like this:
[model: gpt-5.4-mini | reasoning: medium]
What they do support today is configuring custom subagent types with model and model_reasoning_effort.
You can create project-scoped custom agents here:
.codex/agents/
Or personal custom agents here:
~/.codex/agents/
Each custom agent TOML file must include name, description, and developer_instructions. It can also include normal Codex config keys such as model, model_reasoning_effort, and sandbox_mode.
Example:
# .codex/agents/scaffolder.toml
name = "scaffolder"
description = "Fast implementation agent for boilerplate, project setup, and straightforward file creation."
model = "gpt-5.4-mini"
model_reasoning_effort = "medium"
developer_instructions = """
Implement scoped, straightforward tasks quickly.
Keep changes small and follow existing project conventions.
"""
# .codex/agents/architect.toml
name = "architect"
description = "Deep reasoning agent for architecture, state machines, and critical logic."
model = "gpt-5.5"
model_reasoning_effort = "high"
developer_instructions = """
Handle ambiguous or high-impact design work.
Trace tradeoffs, edge cases, and integration risks before recommending changes.
"""
Then ask Codex to use those agent names explicitly:
Spawn scaffolder for T001 and architect for T020. Use each task's notes as the worker prompt.
Useful global subagent settings can go in .codex/config.toml or ~/.codex/config.toml:
[agents]
max_threads = 6
max_depth = 1
The docs say omitted custom-agent fields inherit from the parent session, so leaving out model or model_reasoning_effort gives you the fallback behavior you want.
Here are the links to the relevant docs:
- Codex Subagents
- Subagent model and reasoning guidance
- Codex Configuration Reference
- Configuration Precedence
Discussion in the ATmosphere