Skip to content

Commit 698a57f

Browse files
committed
allow for effort equals null values
1 parent 98d01d9 commit 698a57f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/opencode/src/provider/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ const ProviderInterleaved = Schema.Union([
984984
const ProviderReasoningOption = Schema.Union([
985985
Schema.Struct({
986986
type: Schema.Literal("effort"),
987-
values: Schema.Array(Schema.NullOr(Schema.String)),
987+
values: Schema.Array(Schema.String),
988988
}),
989989
Schema.Struct({
990990
type: Schema.Literal("toggle"),
@@ -1234,7 +1234,7 @@ function normalizeReasoningOption(option: unknown): ReasoningOption | undefined
12341234
if (!Array.isArray(option.values)) return
12351235
return {
12361236
type: "effort",
1237-
values: option.values.filter((value): value is string | null => value === null || typeof value === "string"),
1237+
values: option.values.filter((value): value is string => typeof value === "string"),
12381238
}
12391239
}
12401240
if (option.type === "toggle") return { type: "toggle" }

packages/opencode/test/provider/provider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ test("models.dev reasoning options normalize to known shapes", () => {
14491449
} as unknown as ModelsDev.Provider)
14501450

14511451
expect(provider.models.reasoner.reasoning_options).toEqual([
1452-
{ type: "effort", values: ["high", null] },
1452+
{ type: "effort", values: ["high"] },
14531453
{ type: "toggle" },
14541454
{ type: "budget_tokens", min: 1024 },
14551455
])

0 commit comments

Comments
 (0)