-
Notifications
You must be signed in to change notification settings - Fork 22
[Feature]: Dynamic model routing for sub-agent dispatch #116
Description
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:
- Wasted compute — running Opus on mechanical tasks costs 5–7× more than Sonnet with zero quality gain
- Context reload cost — each new session re-reads the codebase and plan from scratch
- Coordination overhead — the user becomes a manual router between AI models
- 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
modelis specified → override the agent's configured model for this invocation only - If
modelis 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 listoutput
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.