Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/opencode-2-2-1-carrier.md

This file was deleted.

4 changes: 2 additions & 2 deletions examples/next/harnesses/opencode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"dependencies": {
"@cloudflare/computer": "^0.8.0",
"@cloudflare/kumo": "^2.6.0",
"@opencode/plugin": "2.2.1",
"@opencode/sdk": "2.2.1",
"@opencode/plugin": "2.0.24",
"@opencode/sdk": "2.0.24",
"@phosphor-icons/react": "^2.1.10",
"@streamdown/code": "^1.1.1",
"agents": "*",
Expand Down
2 changes: 1 addition & 1 deletion examples/next/harnesses/opencode/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
name: "empty-httpapi-scalar",
enforce: "pre",
load: (id) =>
id.includes("/effect/dist/http-api/internal/httpApiScalar.js")
id.includes("/effect/dist/unstable/httpapi/internal/httpApiScalar.js")
? 'export const javascript = "";'
: null
},
Expand Down
4 changes: 2 additions & 2 deletions packages/agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"@modelcontextprotocol/conformance-v2": "npm:@modelcontextprotocol/conformance@0.2.0-alpha.12",
"@modelcontextprotocol/sdk": "1.32.2",
"@modelcontextprotocol/server": "2.4.0",
"@opencode/plugin": "2.2.1",
"@opencode/sdk": "2.2.1",
"@opencode/plugin": "2.0.24",
"@opencode/sdk": "2.0.24",
"@tanstack/ai": "0.38.0",
"@types/react": "^19.2.17",
"@valibot/to-json-schema": "1.3.0",
Expand Down
18 changes: 1 addition & 17 deletions packages/agents/src/harness/opencode/tests/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,10 @@ export default defineConfig({
name: "empty-httpapi-scalar",
enforce: "pre",
load: (id) =>
id.includes("/effect/dist/http-api/internal/httpApiScalar.js")
id.includes("/effect/dist/unstable/httpapi/internal/httpApiScalar.js")
? 'export const javascript = "";'
: null
},
{
// OpenCode inlines models.dev's catalog as one 8 MB string, too large
// for the message that carries a module into the test runtime. These
// tests turn catalog fetches off and use only the Cloudflare provider,
// so an empty catalog stands in.
name: "empty-models-dev-snapshot",
enforce: "pre",
transform: (code, id) =>
id.includes("/@opencode/core/dist/") &&
code.includes("// src/models-dev/snapshot.txt")
? code.replace(
/(\/\/ src\/models-dev\/snapshot\.txt\nvar snapshot_default = )'.*';/,
"$1'{}';"
)
: null
},
stripNodeModulesSourceMapReferences(),
cloudflareTest({
wrangler: { configPath: path.join(testsDir, "wrangler.jsonc") }
Expand Down
10 changes: 4 additions & 6 deletions packages/agents/src/models/opencode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ export const CLOUDFLARE_PROVIDER_ID = "cloudflare";
* (make the model). Its `sdk` step can only load packages it bundles; any
* other is handed to an npm installer that cannot run in workerd, and an
* external plugin's `sdk` hook runs after that installer. So the provider
* names `gitlab-ai-provider`, which OpenCode bundles and loads in-process
* for any provider that names it (OpenCode 2.2.1 stopped bundling
* `@ai-sdk/vercel`, the package used before), and this plugin's `language`
* hook replaces the model it would make. The GitLab client is built but
* never called.
* names `@ai-sdk/vercel`, which OpenCode bundles and loads in-process, and
* this plugin's `language` hook replaces the model it would make. The
* Vercel client is built but never called: its base URL does not resolve.
*/
const CARRIER_PACKAGE = "aisdk:gitlab-ai-provider";
const CARRIER_PACKAGE = "aisdk:@ai-sdk/vercel";
const UNREACHABLE_BASE_URL = "https://workers-ai.binding.invalid/v1";

/**
Expand Down
Loading
Loading