|
|
@@ -85,6 +85,7 @@ describe("provider package entrypoints", () => {
|
|
|
headers: { "x-application": "opencode" },
|
|
|
body: { metadata: { user_id: "user_1" } },
|
|
|
limits: { context: 200_000, output: 64_000 },
|
|
|
+ providerOptions: { anthropic: { effort: "low" } },
|
|
|
})
|
|
|
|
|
|
expect(String(selected.provider)).toBe("example")
|
|
|
@@ -96,6 +97,19 @@ describe("provider package entrypoints", () => {
|
|
|
expect(selected.route.defaults.headers).toEqual({ "x-application": "opencode" })
|
|
|
expect(selected.route.defaults.http?.body).toEqual({ metadata: { user_id: "user_1" } })
|
|
|
expect(selected.route.defaults.limits).toEqual({ context: 200_000, output: 64_000 })
|
|
|
+ expect(selected.route.defaults.providerOptions).toEqual({ anthropic: { effort: "low" } })
|
|
|
+ })
|
|
|
+
|
|
|
+ test("maps Anthropic provider options onto the executable model", async () => {
|
|
|
+ const Anthropic = await import("@opencode-ai/ai/providers/anthropic")
|
|
|
+ const selected = Anthropic.model("claude-sonnet-4-6", {
|
|
|
+ apiKey: "fixture",
|
|
|
+ providerOptions: { anthropic: { thinking: { type: "adaptive" } } },
|
|
|
+ })
|
|
|
+
|
|
|
+ expect(selected.route.defaults.providerOptions).toEqual({
|
|
|
+ anthropic: { thinking: { type: "adaptive" } },
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
test("requires an Anthropic-compatible base URL at runtime", async () => {
|