Skip to content

Commit 20be6a8

Browse files
committed
fix(opencode): ignore inferred reasoning defaults in display
1 parent 517ca45 commit 20be6a8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/shared/src/model.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ describe("provider-reported option display", () => {
335335
expect(descriptor.options.map((option) => option.id)).toEqual(["none", "thinking"]);
336336
expect(buildProviderOptionSelectionsFromDescriptors([descriptor])).toBeUndefined();
337337
expect(getProviderOptionCurrentLabel(descriptor, selection)).toBe("Unknown");
338+
expect(
339+
getProviderOptionCurrentLabel({ ...descriptor, currentValue: "thinking" }, selection),
340+
).toBe("Unknown");
338341
});
339342

340343
it.each([

‎packages/shared/src/model.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,19 @@ export function getProviderOptionCurrentValue(
210210
if (!descriptor) {
211211
return undefined;
212212
}
213+
const hasExplicitOption = selection?.options?.some((option) => option.id === descriptor.id);
213214
// Reported values are display-only; callers that build dispatch options omit this context.
214215
if (
215216
selection &&
216217
reportedSelection &&
217218
selection.instanceId === reportedSelection.instanceId &&
218219
selection.model === reportedSelection.model &&
219-
!selection.options?.some((option) => option.id === descriptor.id)
220+
!hasExplicitOption
220221
) {
221222
const reportedValue = getRawSelectionValueById(reportedSelection.options, descriptor.id);
222223
if (reportedValue !== undefined) return reportedValue;
223224
}
225+
if (descriptor.id === "variant" && selection && !hasExplicitOption) return undefined;
224226
if (descriptor.type === "boolean") {
225227
return descriptor.currentValue;
226228
}

0 commit comments

Comments
 (0)