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
@@ -912,7 +912,7 @@ export class ModelSelectorComponent extends Container {
}
#getResolvedRoleThinkingLevel(
role: string,
resolved: { explicitThinkingLevel: boolean; thinkingLevel?: ThinkingLevel },
resolved: { explicitThinkingLevel: boolean; thinkingLevel?: ConfiguredThinkingLevel },
): ConfiguredThinkingLevel {
if (resolved.explicitThinkingLevel && resolved.thinkingLevel !== undefined) {
return resolved.thinkingLevel;