Repository navigation
fix(agents): upgrade opencode to 2.2.1 - #2776
mattzcarey wants to merge 2 commits into
Conversation
This reverts commit 5cfafcf.
* fix(agents): upgrade opencode to 2.2.1 Move the @opencode/sdk and @opencode/plugin dev and example pins from 2.0.24 to 2.2.1 and regenerate pnpm-lock.yaml. @opencode/core 2.2.1 no longer bundles @ai-sdk/vercel, the package agents/models/opencode named so OpenCode loads it in-process; every turn failed with provider.no-route. The provider now names gitlab-ai-provider, which OpenCode 2.0.24 to 2.2.1 all load in-process. Peer range unchanged. The Effect 4.0.1 Scalar stub path moves in the test config and example, and the test config swaps OpenCode's 8 MB models.dev catalog for an empty one so the test runtime can load it. Supersedes #2725. Gardener-Operation: op_01cd0a42d8cacef705791a2563f399f6f2ecfd9e224ab4bd67b0ca9942cc803e:90fbc03809c64d97ed870f4c44c25e8147b472a47fb479caa9877d85e9ebfa36 * docs(changeset): link the OpenCode example README from the carrier changeset Gardener-Operation: op_1437d3ebe8d4d6923fc425988e7a04f125ee356ea2fef9384556708b30267bee:0f48d6f725a39c5bec490ab674abd418b4e3df574a103736d9e1c5b30863386a --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🦋 Changeset detectedLatest commit: a974f5c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
|
We're holding this until OpenCode lets a plugin supply its own AI SDK provider. We don't want to ship Cloudflare models carried by Why we can't do it today, on opencode 2.2.1 and
What we'll ship once OpenCode runs the npm loader as a fallback, after plugin hooks: const CARRIER_PACKAGE = "aisdk:agents/models/opencode";
await ctx.aisdk.hook("sdk", (event) => {
event.sdk = {
languageModel: (id: string) =>
asLanguageModelV3(aiSdk.languageModel(id, models.get(id)))
};
}, { providerID });To test it, I ran this against opencode 2.2.1 with
Until then, users on opencode 2.2.1 get |
|
Tracking the OpenCode change we need in #2777. |
Redoes #2767: moves
agents/harness/opencode,agents/models/opencodeand the OpenCode example to opencode 2.2.1. Draft until we replace thegitlab-ai-providercarrier with a proper way to supply the Cloudflare provider.@opencode/core2.2.1 no longer bundles@ai-sdk/vercel. OpenCode loaded that package in-process for us, and ourlanguagehook then swapped in our model (packages/agents/src/models/opencode/index.ts).provider.no-route.gitlab-ai-provider, which works only because OpenCode's GitLab plugin loads it for any provider that names it. Using a GitLab package to carry Cloudflare models is a hack and depends on OpenCode internals. What we need is a way to supply an AI SDK model from a plugin without going through OpenCode's package loader.Stacked on #2775 (the revert). Validated so far, with the current carrier: harness and model tests on 2.2.1 and 2.0.24, and a deployed Worker on the
agentsaccount running Workers AI,openai/gpt-5.5andanthropic/claude-opus-4.8through AI Gateway, including tool calls.