Model-aware task delegation for subagents

Right now, when I create implementation plans, I often annotate each task with the recommended model and reasoning level, for example:

- [ ] T005 Add the SwiftUI app entry point and SwiftData model container wiring in DriftApp/App/DriftApp.swift
  [model: gpt-5.4-mini | reasoning: medium]

This works well for planning, but when the orchestrator spawns subagents, they currently inherit the orchestrator’s own model instead of using the task-level configuration.

That creates friction because I have to manually switch models for nearly every task.

It would be extremely useful if the orchestrator could:

  • Parse task metadata automatically

  • Spawn subagents with the requested model

  • Apply the specified reasoning level (low, medium, high, etc.)

  • Optionally fall back to the orchestrator defaults if no task-level config is provided

Example:

- [ ] T001 Create the SwiftUI iOS app project
  [model: gpt-5.4-mini | reasoning: medium]

- [ ] T020 Design subscription state machine
  [model: gpt-5.5 | reasoning: high]

This would enable much better cost/performance optimization:

  • cheap models for scaffolding and boilerplate

  • stronger models for architecture and critical logic

  • more predictable execution across large implementation plans

For agentic workflows and spec-driven development, this would be a huge productivity improvement.

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: