fix: load model_overrides from config and use resolveModelInternal in CLI

loadConfig() never returned model_overrides, so resolveModelInternal()
could never find per-agent overrides — they were silently ignored.

Additionally, cmdResolveModel duplicated model resolution logic but
skipped the override check entirely. Now delegates to resolveModelInternal
so both code paths behave consistently.
This commit is contained in:
Ethan Hurst
2026-02-24 20:07:15 +10:00
parent 7f5ae23fc2
commit 752e038914
2 changed files with 5 additions and 9 deletions

View File

@@ -204,17 +204,12 @@ function cmdResolveModel(cwd, agentType, raw) {
const config = loadConfig(cwd);
const profile = config.model_profile || 'balanced';
const model = resolveModelInternal(cwd, agentType);
const agentModels = MODEL_PROFILES[agentType];
if (!agentModels) {
const result = { model: 'sonnet', profile, unknown_agent: true };
output(result, raw, 'sonnet');
return;
}
const resolved = agentModels[profile] || agentModels['balanced'] || 'sonnet';
const model = resolved === 'opus' ? 'inherit' : resolved;
const result = { model, profile };
const result = agentModels
? { model, profile }
: { model, profile, unknown_agent: true };
output(result, raw, model);
}

View File

@@ -104,6 +104,7 @@ function loadConfig(cwd) {
verifier: get('verifier', { section: 'workflow', field: 'verifier' }) ?? defaults.verifier,
parallelization,
brave_search: get('brave_search') ?? defaults.brave_search,
model_overrides: parsed.model_overrides || null,
};
} catch {
return defaults;