Eliminate "Default" from thinking selector, always resolve to a real option
Like the model selector, the thinking selector now always resolves to an actual thinking option ID instead of falling back to "Default" display text.
This commit is contained in:
@@ -112,7 +112,7 @@ describe("resolveAgentModelSelection", () => {
|
||||
|
||||
expect(selection.activeModelId).toBe("default");
|
||||
expect(selection.displayModel).toBe("Default (Sonnet 4.6)");
|
||||
expect(selection.selectedThinkingId).toBeNull();
|
||||
expect(selection.displayThinking).toBe("Default");
|
||||
expect(selection.selectedThinkingId).toBe("low");
|
||||
expect(selection.displayThinking).toBe("Low");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -166,7 +166,11 @@ function ControlledStatusBar({
|
||||
isModelLoading && (!modelOptions || modelOptions.length === 0)
|
||||
? "Loading models..."
|
||||
: findOptionLabel(modelOptions, selectedModelId, "Select model");
|
||||
const displayThinking = findOptionLabel(thinkingOptions, selectedThinkingOptionId, "Default");
|
||||
const displayThinking = findOptionLabel(
|
||||
thinkingOptions,
|
||||
selectedThinkingOptionId,
|
||||
thinkingOptions?.[0]?.label ?? "Unknown",
|
||||
);
|
||||
|
||||
const modeVisuals = selectedModeId ? getModeVisuals(provider, selectedModeId) : undefined;
|
||||
const ModeIconComponent = modeVisuals?.icon ? MODE_ICONS[modeVisuals.icon] : null;
|
||||
|
||||
@@ -48,15 +48,15 @@ export function resolveAgentModelSelection(input: {
|
||||
selectedModel?.label ?? preferredModelId ?? fallbackModel?.label ?? "Unknown model";
|
||||
|
||||
const thinkingOptions = selectedModel?.thinkingOptions ?? null;
|
||||
const selectedThinkingId =
|
||||
const resolvedThinkingId =
|
||||
explicitThinkingOptionId && explicitThinkingOptionId !== "default"
|
||||
? explicitThinkingOptionId
|
||||
: (selectedModel?.defaultThinkingOptionId ?? null);
|
||||
const selectedThinking =
|
||||
thinkingOptions?.find((option) => option.id === selectedThinkingId) ?? null;
|
||||
const displayThinking =
|
||||
selectedThinking?.label ??
|
||||
(selectedThinkingId === "default" ? "Model default" : (selectedThinkingId ?? "Default"));
|
||||
thinkingOptions?.find((option) => option.id === resolvedThinkingId) ?? null;
|
||||
const effectiveThinking = selectedThinking ?? thinkingOptions?.[0] ?? null;
|
||||
const selectedThinkingId = effectiveThinking?.id ?? null;
|
||||
const displayThinking = effectiveThinking?.label ?? selectedThinkingId ?? "Unknown";
|
||||
|
||||
return {
|
||||
selectedModel,
|
||||
|
||||
@@ -161,7 +161,7 @@ function resolveThinkingOptionId(args: {
|
||||
return normalizedThinkingOptionId;
|
||||
}
|
||||
|
||||
return effectiveModel?.defaultThinkingOptionId ?? "";
|
||||
return effectiveModel?.defaultThinkingOptionId ?? thinkingOptions[0]?.id ?? "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user