feat: add inherit model profile for OpenCode /model (#951)
This commit is contained in:
@@ -405,9 +405,10 @@ function resolveModelInternal(cwd, agentType) {
|
||||
}
|
||||
|
||||
// Fall back to profile lookup
|
||||
const profile = config.model_profile || 'balanced';
|
||||
const profile = String(config.model_profile || 'balanced').toLowerCase();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ function cmdValidateHealth(cwd, options, raw) {
|
||||
const raw = fs.readFileSync(configPath, 'utf-8');
|
||||
const parsed = JSON.parse(raw);
|
||||
// Validate known fields
|
||||
const validProfiles = ['quality', 'balanced', 'budget'];
|
||||
const validProfiles = ['quality', 'balanced', 'budget', 'inherit'];
|
||||
if (parsed.model_profile && !validProfiles.includes(parsed.model_profile)) {
|
||||
addIssue('warning', 'W004', `config.json: invalid model_profile "${parsed.model_profile}"`, `Valid values: ${validProfiles.join(', ')}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user