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 config = loadConfig(cwd);
|
||||||
const profile = config.model_profile || 'balanced';
|
const profile = config.model_profile || 'balanced';
|
||||||
|
const model = resolveModelInternal(cwd, agentType);
|
||||||
|
|
||||||
const agentModels = MODEL_PROFILES[agentType];
|
const agentModels = MODEL_PROFILES[agentType];
|
||||||
if (!agentModels) {
|
const result = agentModels
|
||||||
const result = { model: 'sonnet', profile, unknown_agent: true };
|
? { model, profile }
|
||||||
output(result, raw, 'sonnet');
|
: { model, profile, unknown_agent: true };
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const resolved = agentModels[profile] || agentModels['balanced'] || 'sonnet';
|
|
||||||
const model = resolved === 'opus' ? 'inherit' : resolved;
|
|
||||||
const result = { model, profile };
|
|
||||||
output(result, raw, model);
|
output(result, raw, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ function loadConfig(cwd) {
|
|||||||
verifier: get('verifier', { section: 'workflow', field: 'verifier' }) ?? defaults.verifier,
|
verifier: get('verifier', { section: 'workflow', field: 'verifier' }) ?? defaults.verifier,
|
||||||
parallelization,
|
parallelization,
|
||||||
brave_search: get('brave_search') ?? defaults.brave_search,
|
brave_search: get('brave_search') ?? defaults.brave_search,
|
||||||
|
model_overrides: parsed.model_overrides || null,
|
||||||
};
|
};
|
||||||
} catch {
|
} catch {
|
||||||
return defaults;
|
return defaults;
|
||||||
|
|||||||
Reference in New Issue
Block a user