Skip to content

Commit edac8eb

Browse files
author
lemoncrow-sync[bot]
committed
Merge remote-tracking branch 'upstream/dev' into dev
2 parents 967ad6f + 959c8bd commit edac8eb

6 files changed

Lines changed: 55 additions & 5 deletions

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ function sdkKey(npm: string): string | undefined {
8484
return "gateway"
8585
case "@openrouter/ai-sdk-provider":
8686
return "openrouter"
87+
case "merge-gateway-ai-sdk-provider":
88+
return "mergeGateway"
8789
case "ai-gateway-provider":
8890
// ai-gateway-provider/unified wraps createOpenAICompatible({ name: "Unified" }),
8991
// and @ai-sdk/openai-compatible parses compatibleOptions from one of
@@ -1772,6 +1774,7 @@ function reasoningEffort(model: Provider.Model, effort: string) {
17721774
case "@ai-sdk/togetherai":
17731775
case "venice-ai-sdk-provider":
17741776
case "ai-gateway-provider":
1777+
case "merge-gateway-ai-sdk-provider":
17751778
return { reasoningEffort: effort }
17761779
case "@ai-sdk/cohere":
17771780
case "@ai-sdk/perplexity":

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,33 @@ test("models.dev reasoning options replace generated variants and unsupported to
15481548
expect(models["gemini-3-pro-fast"].variants).toEqual(models.override.variants)
15491549
})
15501550

1551+
test("MERGE Gateway exposes declared effort variants without model-specific handling", () => {
1552+
const provider = {
1553+
id: "merge-gateway",
1554+
name: "MERGE Gateway",
1555+
env: ["MERGE_GATEWAY_API_KEY"],
1556+
npm: "merge-gateway-ai-sdk-provider",
1557+
models: {
1558+
"openai/gpt-5.6-sol": {
1559+
id: "openai/gpt-5.6-sol",
1560+
name: "GPT-5.6 Sol",
1561+
reasoning: true,
1562+
reasoning_options: [{ type: "effort", values: ["none", "low", "medium", "high", "xhigh", "max"] }],
1563+
limit: { context: 128_000, output: 64_000 },
1564+
},
1565+
},
1566+
} as unknown as ModelsDev.Provider
1567+
1568+
expect(Provider.fromModelsDevProvider(provider).models["openai/gpt-5.6-sol"].variants).toEqual({
1569+
none: { reasoningEffort: "none" },
1570+
low: { reasoningEffort: "low" },
1571+
medium: { reasoningEffort: "medium" },
1572+
high: { reasoningEffort: "high" },
1573+
xhigh: { reasoningEffort: "xhigh" },
1574+
max: { reasoningEffort: "max" },
1575+
})
1576+
})
1577+
15511578
test("public provider info omits invalid models", () => {
15521579
const provider = Provider.fromModelsDevProvider({
15531580
id: "test",

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,6 +3370,7 @@ describe("ProviderTransform.reasoningVariants", () => {
33703370
["@ai-sdk/togetherai", { reasoningEffort: "high" }],
33713371
["venice-ai-sdk-provider", { reasoningEffort: "high" }],
33723372
["ai-gateway-provider", { reasoningEffort: "high" }],
3373+
["merge-gateway-ai-sdk-provider", { reasoningEffort: "high" }],
33733374
["@ai-sdk/amazon-bedrock", { reasoningConfig: { type: "enabled", maxReasoningEffort: "high" } }],
33743375
])("converts effort for %s", (npm, expected, ...args) => {
33753376
const id = args[0] as string | undefined
@@ -5555,6 +5556,25 @@ describe("ProviderTransform.providerOptions - ai-gateway-provider", () => {
55555556
})
55565557
})
55575558

5559+
describe("ProviderTransform.providerOptions - merge-gateway-ai-sdk-provider", () => {
5560+
const model = {
5561+
id: "merge-gateway/openai/gpt-5.6-sol",
5562+
providerID: "merge-gateway",
5563+
api: {
5564+
id: "openai/gpt-5.6-sol",
5565+
url: "https://api-gateway.merge.dev/v1/ai-sdk",
5566+
npm: "merge-gateway-ai-sdk-provider",
5567+
},
5568+
capabilities: { reasoning: true },
5569+
} as any
5570+
5571+
test("routes normalized effort under the adapter's mergeGateway key", () => {
5572+
expect(ProviderTransform.providerOptions(model, { reasoningEffort: "high" })).toEqual({
5573+
mergeGateway: { reasoningEffort: "high" },
5574+
})
5575+
})
5576+
})
5577+
55585578
describe("ProviderTransform.options - kimi family adaptive thinking", () => {
55595579
const createModel = (overrides: Record<string, any> = {}) =>
55605580
({

packages/web/src/content/docs/ecosystem.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can also check out [awesome-opencode](https://github.com/awesome-opencode/aw
1717

1818
| Name | Description |
1919
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
20-
| [opencode-daytona](https://github.com/daytonaio/daytona/tree/main/libs/opencode-plugin) | Automatically run OpenCode sessions in isolated Daytona sandboxes with git sync and live previews |
20+
| [opencode-daytona](https://github.com/daytona/integrations/tree/main/packages/opencode-plugin) | Automatically run OpenCode sessions in isolated Daytona sandboxes with git sync and live previews |
2121
| [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) | Automatically inject Helicone session headers for request grouping |
2222
| [opencode-type-inject](https://github.com/nick-vi/opencode-type-inject) | Auto-inject TypeScript/Svelte types into file reads with lookup tools |
2323
| [opencode-openai-codex-auth](https://github.com/numman-ali/opencode-openai-codex-auth) | Use your ChatGPT Plus/Pro subscription instead of API credits |

packages/web/src/content/docs/github.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Or you can set it up manually.
9797
issues: write
9898
```
9999
100-
You can also use a [personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)(PAT) if preferred.
100+
You can also use a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)(PAT) if preferred.
101101
102102
---
103103

packages/web/src/content/docs/providers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ Cloudflare Workers AI lets you run AI models on Cloudflare's global network dire
759759

760760
### DigitalOcean
761761

762-
DigitalOcean's [Inference Engine](https://docs.digitalocean.com/products/inference/) provides access to open models like GPT-OSS, Llama, Qwen, and DeepSeek, plus custom [Inference Routers](https://docs.digitalocean.com/products/genai-platform/concepts/inference-routers/) that route each request to the cheapest, fastest, or best-fit model for a task.
762+
DigitalOcean's [Inference Engine](https://docs.digitalocean.com/products/inference/) provides access to open models like GPT-OSS, Llama, Qwen, and DeepSeek, plus custom [Inference Routers](https://docs.digitalocean.com/products/inference/how-to/use-inference-router/) that route each request to the cheapest, fastest, or best-fit model for a task.
763763

764764
OpenCode supports two authentication methods:
765765

@@ -2487,7 +2487,7 @@ You can use any OpenAI-compatible provider with opencode. Most modern AI provide
24872487
"provider": {
24882488
"myprovider": {
24892489
"npm": "@ai-sdk/openai-compatible",
2490-
"name": "My AI ProviderDisplay Name",
2490+
"name": "My AI Provider Display Name",
24912491
"options": {
24922492
"baseURL": "https://api.myprovider.com/v1"
24932493
},
@@ -2525,7 +2525,7 @@ Here's an example setting the `apiKey`, `headers`, and model `limit` options.
25252525
"provider": {
25262526
"myprovider": {
25272527
"npm": "@ai-sdk/openai-compatible",
2528-
"name": "My AI ProviderDisplay Name",
2528+
"name": "My AI Provider Display Name",
25292529
"options": {
25302530
"baseURL": "https://api.myprovider.com/v1",
25312531
"apiKey": "{env:ANTHROPIC_API_KEY}",

0 commit comments

Comments
 (0)