Skip to content

Commit e41e7e9

Browse files
authored
refactor(ai): rename OpenCodeZen provider to OpenCode (#54767)
1 parent 0cb4347 commit e41e7e9

8 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎packages/ai/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ console.log(response.answers.department.choice)
182182
console.log(response.answers.refund.probability)
183183
```
184184

185-
`TypeSafeAI` reads `TYPESAFE_API_KEY`. `OpenCodeZen` exposes the same selector and reads
185+
`TypeSafeAI` reads `TYPESAFE_API_KEY`. `OpenCode` exposes the same selector and reads
186186
`OPENCODE_API_KEY`. OpenRouter and Vercel AI Gateway use the same provider shape:
187187

188188
```ts

‎packages/ai/src/providers/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export * as Moonshot from "./moonshot.js"
3434
export * as OpenAI from "./openai.js"
3535
export * as OpenAICompatible from "./openai-compatible.js"
3636
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js"
37-
export * as OpenCodeZen from "./opencode-zen.js"
37+
export * as OpenCode from "./opencode.js"
3838
export * as OpenRouter from "./openrouter.js"
3939
export * as Replicate from "./replicate.js"
4040
export * as Runway from "./runway.js"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js"
33
import { SystemOne } from "../experimental/system-one.js"
44

55
export const id = ProviderID.make("opencode")
6-
const baseURL = "https://opencode.ai/zen/v1"
6+
const baseURL = "https://opencode.ai/inference/v1"
77

88
export type Options = ProviderAuthOption<"optional"> & {
99
readonly baseURL?: string
@@ -28,4 +28,4 @@ export const configure = (input: Options = {}) => {
2828
export const provider = configure()
2929
export const experimental = provider.experimental
3030

31-
export * as OpenCodeZen from "./opencode-zen.js"
31+
export * as OpenCode from "./opencode.js"

‎packages/ai/test/evaluation.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect } from "bun:test"
22
import { Effect, Layer } from "effect"
33
import { HttpClientRequest } from "effect/http"
44
import { Evaluation, EvaluationClient } from "../src/experimental.js"
5-
import { OpenCodeZen, OpenRouter, TypeSafeAI, VercelAIGateway } from "../src/providers.js"
5+
import { OpenCode, OpenRouter, TypeSafeAI, VercelAIGateway } from "../src/providers.js"
66
import { it } from "./lib/effect.js"
77
import { dynamicResponse } from "./lib/http.js"
88

@@ -116,9 +116,9 @@ describe("experimental Evaluation", () => {
116116
),
117117
)
118118

119-
it.effect("configures the OpenCode Zen System One endpoint", () =>
119+
it.effect("configures the OpenCode System One endpoint", () =>
120120
Evaluation.run({
121-
model: OpenCodeZen.configure({ apiKey: "zen-key", baseURL: "https://zen.test/v1" }).experimental.evaluation(
121+
model: OpenCode.configure({ apiKey: "opencode-key", baseURL: "https://opencode.test/v1" }).experimental.evaluation(
122122
"jev-1.13",
123123
),
124124
state: "hello",
@@ -136,8 +136,8 @@ describe("experimental Evaluation", () => {
136136
EvaluationClient.layer.pipe(
137137
Layer.provide(
138138
dynamicResponse((input) => {
139-
expect(input.request.url).toBe("https://zen.test/v1/systemone")
140-
expect(input.request.headers.authorization).toBe("Bearer zen-key")
139+
expect(input.request.url).toBe("https://opencode.test/v1/systemone")
140+
expect(input.request.headers.authorization).toBe("Bearer opencode-key")
141141
return Effect.succeed(
142142
input.respond(
143143
JSON.stringify({

‎packages/ai/test/evaluation.types.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Effect } from "effect"
22
import { Evaluation, EvaluationClient, EvaluationModel, type EvaluationRoute } from "../src/experimental.js"
33
import type { Service } from "../src/experimental/evaluation-client.js"
4-
import { OpenCodeZen, OpenRouter, TypeSafeAI, VercelAIGateway } from "../src/providers.js"
4+
import { OpenCode, OpenRouter, TypeSafeAI, VercelAIGateway } from "../src/providers.js"
55

66
type Requirements<T> = T extends Effect.Effect<infer _A, infer _E, infer R> ? R : never
77
type Success<T> = T extends Effect.Effect<infer A, infer _E, infer _R> ? A : never
@@ -34,7 +34,7 @@ void (true satisfies ClientRequirements)
3434

3535
Effect.gen(function* () {
3636
const response = yield* Evaluation.run({
37-
model: OpenCodeZen.experimental.evaluation("jev-1.13"),
37+
model: OpenCode.experimental.evaluation("jev-1.13"),
3838
state: ["hello"],
3939
questions: { greeting: { type: "boolean", instructions: "Greeting?" } },
4040
})

‎packages/ai/test/exports.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
Fireworks,
3535
Google,
3636
Meta,
37-
OpenCodeZen,
37+
OpenCode,
3838
OpenAI,
3939
OpenAICompatible,
4040
OpenRouter,
@@ -149,7 +149,7 @@ describe("public exports", () => {
149149
expect(OpenRouter.model).toBeFunction()
150150
expect(OpenRouter.experimental.evaluation).toBeFunction()
151151
expect(TypeSafeAI.experimental.evaluation).toBeFunction()
152-
expect(OpenCodeZen.experimental.evaluation).toBeFunction()
152+
expect(OpenCode.experimental.evaluation).toBeFunction()
153153
expect(VercelAIGateway.experimental.evaluation).toBeFunction()
154154
expect(XAI.model).toBeFunction()
155155
expect(XAI.provider.responses).toBe(XAI.responses)

packages/ai/test/fixtures/recordings/opencode-zen-evaluation/evaluates-choice-score-and-boolean-questions.json renamed to packages/ai/test/fixtures/recordings/opencode-evaluation/evaluates-choice-score-and-boolean-questions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"metadata": {
44
"model": "jev-1.13-free",
55
"tags": [
6-
"prefix:opencode-zen-evaluation",
6+
"prefix:opencode-evaluation",
77
"provider:opencode",
88
"protocol:system-one"
99
],
10-
"name": "opencode-zen-evaluation/evaluates-choice-score-and-boolean-questions",
10+
"name": "opencode-evaluation/evaluates-choice-score-and-boolean-questions",
1111
"recordedAt": "2026-09-22T03:44:57.511Z"
1212
},
1313
"interactions": [
1414
{
1515
"transport": "http",
1616
"request": {
1717
"method": "POST",
18-
"url": "https://opencode.ai/zen/v1/systemone",
18+
"url": "https://opencode.ai/inference/v1/systemone",
1919
"headers": {
2020
"content-type": "application/json"
2121
},

‎packages/ai/test/provider/evaluation.recorded.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect } from "bun:test"
22
import { Effect } from "effect"
33
import { Evaluation, EvaluationModel, type EvaluationOptions } from "../../src/experimental.js"
4-
import { OpenCodeZen, OpenRouter, TypeSafeAI } from "../../src/providers.js"
4+
import { OpenCode, OpenRouter, TypeSafeAI } from "../../src/providers.js"
55
import { recordedTests } from "../recorded-test.js"
66

77
const questions = {
@@ -32,8 +32,8 @@ const typesafe = recordedTests({
3232
metadata: { model: "jev-latest" },
3333
})
3434

35-
const zen = recordedTests({
36-
prefix: "opencode-zen-evaluation",
35+
const opencode = recordedTests({
36+
prefix: "opencode-evaluation",
3737
provider: "opencode",
3838
protocol: "system-one",
3939
requires: ["OPENCODE_API_KEY"],
@@ -55,9 +55,9 @@ describe("experimental Evaluation recorded", () => {
5555
),
5656
)
5757

58-
zen.effect("evaluates choice score and boolean questions", () =>
58+
opencode.effect("evaluates choice score and boolean questions", () =>
5959
assertEvaluation(
60-
OpenCodeZen.configure({ apiKey: process.env.OPENCODE_API_KEY ?? "fixture" }).experimental.evaluation(
60+
OpenCode.configure({ apiKey: process.env.OPENCODE_API_KEY ?? "fixture" }).experimental.evaluation(
6161
"jev-1.13-free",
6262
),
6363
),

0 commit comments

Comments
 (0)