Skip to content

Commit 971aab2

Browse files
maria-rcksvoltcrash
authored andcommitted
fix(web): limit the empty trait label fallback to thinking
1 parent f380b2a commit 971aab2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/client-runtime/src/modelTraits.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ describe("buildTraitsTriggerDisplay", () => {
99
{ currentValue: undefined, defaultValue: "high", value: "high", label: "High" },
1010
{ currentValue: "low", defaultValue: undefined, value: "low", label: "Low" },
1111
{ currentValue: "max", defaultValue: "high", value: "max", label: "Max" },
12+
{ id: "effort", currentValue: undefined, defaultValue: undefined, value: null, label: "" },
1213
])("labels Pi thinking without inventing a selection: $label ($value)", (input) => {
1314
const descriptor: Extract<ProviderOptionDescriptor, { type: "select" }> = {
14-
id: "thinking",
15+
id: input.id ?? "thinking",
1516
label: "Thinking",
1617
type: "select",
1718
options: ["low", "high", "max"].map((id) => ({

‎packages/client-runtime/src/modelTraits.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function buildTraitsTriggerDisplay(input: {
164164
descriptor,
165165
input.modelSelection,
166166
input.reportedModelSelection,
167-
) ?? (REASONING_SELECT_DESCRIPTOR_IDS.has(descriptor.id) ? descriptor.label : null));
167+
) ?? (descriptor.id === "thinking" ? descriptor.label : null));
168168
if (typeof label === "string" && label.length > 0) {
169169
if (reasoningLabelIndex === -1 && isReasoningSelect(descriptor)) {
170170
reasoningLabelIndex = labels.length;

0 commit comments

Comments
 (0)