feat(config): add per-agent model overrides (#510)

Allow overriding specific agent models without changing the entire profile.
Add model_overrides key to config that takes precedence over profile lookup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-15 10:41:04 -06:00
parent c4ea358920
commit a5caf9194b
2 changed files with 26 additions and 2 deletions

View File

@@ -3620,6 +3620,14 @@ function cmdScaffold(cwd, type, options, raw) {
function resolveModelInternal(cwd, agentType) {
const config = loadConfig(cwd);
// Check per-agent override first
const override = config.model_overrides?.[agentType];
if (override) {
return override === 'opus' ? 'inherit' : override;
}
// Fall back to profile lookup
const profile = config.model_profile || 'balanced';
const agentModels = MODEL_PROFILES[agentType];
if (!agentModels) return 'sonnet';

View File

@@ -42,11 +42,27 @@ Orchestrators resolve model before spawning:
```
1. Read .planning/config.json
2. Get model_profile (default: "balanced")
3. Look up agent in table above
2. Check model_overrides for agent-specific override
3. If no override, look up agent in profile table
4. Pass model parameter to Task call
```
## Per-Agent Overrides
Override specific agents without changing the entire profile:
```json
{
"model_profile": "balanced",
"model_overrides": {
"gsd-executor": "opus",
"gsd-planner": "haiku"
}
}
```
Overrides take precedence over the profile. Valid values: `opus`, `sonnet`, `haiku`.
## Switching Profiles
Runtime: `/gsd:set-profile <profile>`