fix(coding-agent): preserved explicit :auto suffix in modelRoles

The model selector's persistence path dropped the `:auto` selector when parsing role values, producing a warning ('Invalid thinking level "auto"') and rendering the badge as `inherit` instead of `auto`. Reload of the default role also lost the auto state whenever the role value carried an explicit `:auto` suffix instead of relying on `defaultThinkingLevel`.

Widen the resolver chain (`parseThinkingSuffix`, `splitThinkingSuffix`, `parseModelString`, `parseModelPattern*`, `ResolvedModelRoleValue`, `ResolvedRoleModel`, `ResolveCliModelResult`) to carry the `AUTO_THINKING` sentinel end to end, and coerce it back to `undefined` at concrete-only boundaries (glob scope patterns, retry fallback, advisor, commit pipeline, guided-goal, bench).

Regression tests cover:

- `resolveModelRoleValue("provider/model:auto")` returns explicit auto without a warning.

- `ModelSelector` renders `DEFAULT (auto)` and `SMOL (auto)` when the role value has `:auto`.

- `cycleRoleModels` activates auto thinking on entering a `:auto` role.

- Startup resume activates auto thinking when `modelRoles.default` carries `:auto`.

Fixes #4128
This commit is contained in:
roboomp
2026-07-01 08:18:42 +00:00
parent f70e4f1570
commit a4ae4c130c
13 changed files with 178 additions and 39 deletions
+5 -2
View File
@@ -30,7 +30,7 @@ import { buildServiceTierByFamily, serviceTierForAllFamilies, serviceTierSetting
import { Settings } from "../config/settings";
import benchPrompt from "../prompts/bench.md" with { type: "text" };
import { discoverAuthStorage, loadCliExtensionProviders } from "../sdk";
import { resolveThinkingLevelForModel, shouldDisableReasoning, toReasoningEffort } from "../thinking";
import { AUTO_THINKING, resolveThinkingLevelForModel, shouldDisableReasoning, toReasoningEffort } from "../thinking";
const DEFAULT_RUNS = 10;
const DEFAULT_PAR = 4;
@@ -477,7 +477,10 @@ function resolveBenchModels(
resolved.push({
selector,
model,
thinking: resolveThinkingLevelForModel(model, result.thinkingLevel),
thinking: resolveThinkingLevelForModel(
model,
result.thinkingLevel === AUTO_THINKING ? undefined : result.thinkingLevel,
),
});
}
if (errors.length > 0) {