fix(core): return 'opus' directly instead of mapping to 'inherit' (#1079)

resolveModelInternal() was converting 'opus' to 'inherit', assuming
the parent process runs on Opus. When the orchestrator runs on Sonnet
(the default), 'inherit' resolves to Sonnet — silently downgrading
quality profile subagents.

Remove the opus→inherit conversion so the resolved model name is
passed through directly. Claude Code's Task tool now supports model
aliases like 'opus', 'sonnet', 'haiku'.

Fixes #695
This commit is contained in:
Tom Boucher
2026-03-16 10:49:55 -04:00
committed by GitHub
parent 0fde04f561
commit 2b0f595a17

View File

@@ -374,7 +374,7 @@ function resolveModelInternal(cwd, agentType) {
// Check per-agent override first
const override = config.model_overrides?.[agentType];
if (override) {
return override === 'opus' ? 'inherit' : override;
return override;
}
// Fall back to profile lookup
@@ -382,8 +382,7 @@ function resolveModelInternal(cwd, agentType) {
const agentModels = MODEL_PROFILES[agentType];
if (!agentModels) return 'sonnet';
if (profile === 'inherit') return 'inherit';
const resolved = agentModels[profile] || agentModels['balanced'] || 'sonnet';
return resolved === 'opus' ? 'inherit' : resolved;
return agentModels[profile] || agentModels['balanced'] || 'sonnet';
}
// ─── Misc utilities ───────────────────────────────────────────────────────────