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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user