Skip to content

[Feature]: Dynamic model routing for sub-agent dispatch #116

@bordenet

Description

@bordenet

What would you like to be added?

Add an optional model parameter to the sub-agent dispatch interface, allowing the orchestrating agent to specify which model a sub-agent should use at invocation time — instead of only at configuration time via frontmatter.

Why is this needed?

When an AI agent executes a multi-phase plan, different steps have wildly different cognitive demands. A real example: a 7-phase codebase quality uplift needs:

  • Sonnet 4.6 for ~85% of steps (refactoring, test writing, CI config — mechanical + judgment work)
  • Opus 4.6 for ~15% of steps (taxonomy design, quality regression analysis, release decisions)
  • A code review agent between phases (PR review)

Today, the user must manually switch models between sessions. This creates:

  1. Wasted compute — running Opus on mechanical tasks costs 5–7× more than Sonnet with zero quality gain
  2. Context reload cost — each new session re-reads the codebase and plan from scratch
  3. Coordination overhead — the user becomes a manual router between AI models
  4. Lost continuity — the orchestrator loses state at each switch point

What exists today (90% of the way there)

Sub-agents already support static model assignment via frontmatter:

---
name: code-review
model: sonnet4.5
---

And the orchestrator can dispatch to named sub-agents. The infrastructure handles model selection at the config level. The gap: the orchestrator cannot override the model at dispatch time.

Proposed solution

Add an optional model parameter to the sub-agent tool:

{
  "name": "sub-agent",
  "parameters": {
    "action": "run",
    "name": "refactor-phase-1",
    "model": "sonnet4.6",
    "instruction": "Execute Phase 1 per the plan document"
  }
}

Behavior:

  • If model is specified → override the agent's configured model for this invocation only
  • If model is omitted → use the agent's configured model (current behavior, fully backwards compatible)
  • The orchestrator stays on its own model — only the sub-agent switches
  • Validate against auggie models list output

Why this is the right smallest change

The sub-agent infrastructure already handles model selection (via frontmatter). This just exposes it at dispatch time. Same codepath, new entry point.

Cost impact

For the real-world plan described above:

Approach Relative Cost User Effort
All Opus (no routing) 100% Minimal
Manual HALT points ~45% High (6 manual model switches)
Dynamic dispatch (proposed) ~45% Minimal (orchestrator routes automatically)

~55% cost reduction with zero quality compromise and no user intervention.

Current workaround

Create pre-configured sub-agents for each model tier (sonnet-worker.md, opus-reviewer.md) and manually dispatch to the right one. This works but each sub-agent gets a cold-start context window and the user still sequences manually.

Future extension (not part of this request)

A declarative execution plan format (.augment/execution-plans/*.yml) that maps steps to models with dependency ordering — but that needs this primitive first.

Additional context

I maintain a skill framework (superpowers-plus) with 90+ skills and have a detailed analysis of which skills benefit from multi-model sub-agent dispatch. Happy to share the full analysis and cost modeling if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions