fix(#2601): config-set-model-profile now accepts 'inherit' value (#2707)

VALID_PROFILES was derived solely from Object.keys(MODEL_PROFILES['gsd-planner']),
which only contained the named tiers (quality/balanced/budget/adaptive). The
cmdConfigSetModelProfile validator rejected 'inherit' even though the runtime has
supported it since #1829. Fix: append 'inherit' to VALID_PROFILES and handle it
in getAgentToModelMapForProfile so the agent→model table shows 'inherit' instead
of undefined.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-25 12:09:27 -04:00
committed by GitHub
parent b7ff14fe51
commit 8393f4b355
3 changed files with 60 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ const MODEL_PROFILES = {
'gsd-doc-writer': { quality: 'opus', balanced: 'sonnet', budget: 'haiku', adaptive: 'sonnet' },
'gsd-doc-verifier': { quality: 'sonnet', balanced: 'sonnet', budget: 'haiku', adaptive: 'haiku' },
};
const VALID_PROFILES = Object.keys(MODEL_PROFILES['gsd-planner']);
const VALID_PROFILES = [...Object.keys(MODEL_PROFILES['gsd-planner']), 'inherit'];
/**
* Formats the agent-to-model mapping as a human-readable table (in string format).
@@ -58,7 +58,9 @@ function formatAgentToModelMapAsTable(agentToModelMap) {
function getAgentToModelMapForProfile(normalizedProfile) {
const agentToModelMap = {};
for (const [agent, profileToModelMap] of Object.entries(MODEL_PROFILES)) {
agentToModelMap[agent] = profileToModelMap[normalizedProfile];
agentToModelMap[agent] = normalizedProfile === 'inherit'
? 'inherit'
: profileToModelMap[normalizedProfile];
}
return agentToModelMap;
}