Skip to content

Commit 2b15ba0

Browse files
t3dotggclaude
andauthored
fix(web): model settings show "No reasoning" instead of labeling every model (#27891)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 53a986e commit 2b15ba0

1 file changed

Lines changed: 27 additions & 12 deletions

File tree

‎apps/web/src/components/settings/ProviderModelsSection.tsx‎

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ProviderInstanceId,
66
type ServerProviderModel,
77
} from "@t3tools/contracts";
8+
import { REASONING_SELECT_DESCRIPTOR_IDS } from "@t3tools/client-runtime/model-traits";
89
import { type CustomModelDefinition, normalizeCustomModelSlug } from "@t3tools/shared/model";
910

1011
import { useStableCallback } from "../../hooks/useStableCallback";
@@ -27,7 +28,21 @@ const CUSTOM_MODEL_PLACEHOLDER_BY_KIND: Partial<Record<ProviderDriverKind, strin
2728

2829
const FILTER_THRESHOLD = 8;
2930

30-
function describeModelCapabilities(model: ServerProviderModel): string[] {
31+
const PROVIDER_ALIAS_SLUGS = new Set(["default", "auto"]);
32+
33+
function hasReasoningControl(model: ServerProviderModel): boolean {
34+
return (model.capabilities?.optionDescriptors ?? []).some((descriptor) =>
35+
REASONING_SELECT_DESCRIPTOR_IDS.has(descriptor.id),
36+
);
37+
}
38+
39+
// Reasoning is the norm, so only its absence is labeled, and only when other models have it.
40+
// Custom and null capabilities are fallbacks or user-written, not discovered, so they prove nothing.
41+
// Alias slugs ("default", Cursor's "auto") defer to the provider's own model choice, so reasoning is unknown.
42+
function describeModelCapabilities(
43+
model: ServerProviderModel,
44+
flagMissingReasoning: boolean,
45+
): string[] {
3146
const descriptors = model.capabilities?.optionDescriptors ?? [];
3247
const labels: string[] = [];
3348
const hasFastMode = descriptors.some(
@@ -38,18 +53,14 @@ function describeModelCapabilities(model: ServerProviderModel): string[] {
3853
descriptor.options.some((option) => option.id === "fast" || option.label === "Fast")),
3954
);
4055
if (hasFastMode) labels.push("Fast mode");
41-
if (descriptors.some((descriptor) => descriptor.id === "thinking")) labels.push("Thinking");
4256
if (
43-
descriptors.some(
44-
(descriptor) =>
45-
descriptor.type === "select" &&
46-
(descriptor.id === "reasoningEffort" ||
47-
descriptor.id === "effort" ||
48-
descriptor.id === "reasoning" ||
49-
descriptor.id === "variant"),
50-
)
57+
flagMissingReasoning &&
58+
!model.isCustom &&
59+
model.capabilities &&
60+
!PROVIDER_ALIAS_SLUGS.has(model.slug) &&
61+
!hasReasoningControl(model)
5162
) {
52-
labels.push("Reasoning");
63+
labels.push("No reasoning");
5364
}
5465
return labels;
5566
}
@@ -144,6 +155,7 @@ export function ProviderModelsSection({
144155
const hiddenCount = displayModels.filter(
145156
(model) => !model.isCustom && hiddenModelSet.has(model.slug),
146157
).length;
158+
const flagMissingReasoning = models.some(hasReasoningControl);
147159
const showFilter = models.length > FILTER_THRESHOLD;
148160
const normalizedFilter = filter.trim().toLowerCase();
149161
const isFiltering = showFilter && normalizedFilter.length > 0;
@@ -278,6 +290,7 @@ export function ProviderModelsSection({
278290
canMoveUp={!isFiltering && previousModel !== undefined && groupOf(previousModel) === group}
279291
canMoveDown={!isFiltering && nextModel !== undefined && groupOf(nextModel) === group}
280292
isFiltering={isFiltering}
293+
flagMissingReasoning={flagMissingReasoning}
281294
canWritePreferences={canWritePreferences}
282295
canManageCustomModels={canManageCustomModels}
283296
{...rowHandlers}
@@ -437,6 +450,7 @@ function ProviderModelRow({
437450
canMoveUp,
438451
canMoveDown,
439452
isFiltering,
453+
flagMissingReasoning,
440454
canWritePreferences,
441455
canManageCustomModels,
442456
onToggleFavorite,
@@ -451,6 +465,7 @@ function ProviderModelRow({
451465
readonly canMoveUp: boolean;
452466
readonly canMoveDown: boolean;
453467
readonly isFiltering: boolean;
468+
readonly flagMissingReasoning: boolean;
454469
readonly canWritePreferences: boolean;
455470
readonly canManageCustomModels: boolean;
456471
readonly onToggleFavorite: (slug: string) => void;
@@ -459,7 +474,7 @@ function ProviderModelRow({
459474
readonly onToggleEdit: (slug: string) => void;
460475
readonly onRemove: (slug: string) => void;
461476
}) {
462-
const capLabels = describeModelCapabilities(model);
477+
const capLabels = describeModelCapabilities(model, flagMissingReasoning);
463478
const nameClassName = cn("text-xs", isHidden ? "text-muted-foreground" : "text-foreground/90");
464479
const pickerTooltip = model.isCustom
465480
? "Custom models are always shown in the picker"

0 commit comments

Comments
 (0)