Repository navigation
chore(deps): upgrade opencode to 2.2.0 - #2725
github-actions[bot] wants to merge 1 commit into
Conversation
Move the @opencode/sdk and @opencode/plugin dev and example pins from 2.0.24 to 2.2.0 and regenerate pnpm-lock.yaml. opencode 2.1+ is built on Effect 4.0.1, which ships its Scalar UI at effect/dist/http-api/internal/httpApiScalar.js, so the Vite stubs in the harness-opencode test config and the OpenCode example now match that path. @opencode/core 2.2.0 also inlines an 8 MB models.dev catalog in one module, too large to load into the vitest-pool-workers runtime; the harness-opencode test config replaces it with an empty catalog (the tests set models.fetch: false and use only the Cloudflare provider). The peer range (^2.0.24) is unchanged: no published source changed and it already admits 2.2.x. Gardener-Operation: op_9ade73330c5f07fc9d86a625cfa385da9ee226bd44baeffd3b83f4500e0fe876:9e620ecc4ce65c146cb311c2165f594bb915db0225ce74d69edfb63d06e34b94
|
🔴 agents import sizes: 1 entry point over threshold
Changed exports (2)
How this worksEach runtime export is bundled on its own, minified, and gzipped. Changes smaller than 100 B, or smaller than 1% and 1 KiB, are ignored. Growth over 10% or 5 KiB is marked 🔴. This report is informational and does not fail CI. The workflow artifact contains every measurement. Compared |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
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
|
Superseded by #2767, which moves to opencode 2.2.1. It keeps this PR's Scalar-path and models.dev catalog test fixes. It also fixes |
* 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>
Summary
Moves the dev and example pins for
agents/harness/opencodeandagents/models/opencodefrom opencode 2.0.24 to 2.2.0, and fixes the two test-time breaks that come with it.@opencode/sdk(dev pin, example)@opencode/plugin(dev pin, example)^2.0.24^2.0.24(unchanged)Since our pin opencode has released 2.0.25–2.0.32, 2.1.0–2.1.4 and 2.2.0 (published 2026-10-27). Our caret peer range already lets users install all of them. This PR runs our tests and the example on 2.2.0. It supersedes #2692 (2.1.4), which only
github-actions[bot]committed to.What changed upstream that affects us
effect/dist/http-api/internal/httpApiScalar.js, noteffect/dist/unstable/httpapi/.... Our stubs for that 3 MB script matched the old path (packages/agents/src/harness/opencode/tests/vitest.config.ts:16,examples/next/harnesses/opencode/vite.config.ts:16), so the script was loaded unstubbed. Same fix in both files (the stub'sjavascriptexport name is unchanged in 4.0.1):packages/sdkorpackages/plugincommit:@opencode/core2.2.0, which@opencode/sdk2.2.0 depends on, inlines models.dev's catalog snapshot as one string literal,var snapshot_default = '…'under// src/models-dev/snapshot.txt, indist/chunks/tool-8e0gbf5j.js(8,220,573 bytes; 2.0.24's chunk was 5,316,690). With the Scalar path fixed,harness-opencodestill failed: workerd closed the module-runner socket with "WebSocket protocol error; statusCode = 1009; Message is too large".harness.test.tsandtable-prefix.test.tsnever ran, leaving 5/14 tests passing. A temporary size probe showed that chunk is the only transformed module over 1 MB. The test Workers setmodels: { fetch: false }and use only our Cloudflare provider (packages/agents/src/harness/opencode/tests/worker.ts:67-74), so the test config now swaps in an empty catalog (packages/agents/src/harness/opencode/tests/vitest.config.ts:20-35):SessionCompactionResult.providerStatetonative(SessionMessage.Native). Neithermodels/opencodenor the harness implements compaction, and typecheck passes.events.ts:264-268reads onlyreasonanderror.messagefromsession.compaction.*. The same commit changes the stored session schema in@opencode/schema: chore(agents): test against opencode 2.1.4 #2692's review found that it renamesstate/providerState/resultStatetonativeand dropsrecentfrom compaction messages. I did not re-verify that here. It only matters for rollback (see Merge Danger).No effect on us (63)
nativerename,DeepMutable,@opencode/ai/effect, OpenTUI peers, versions, typecheck scripts).ctx.experimental.generateand deprecatesctx.generate(kept astextonly). Our plugins don't callgenerate.@opencode/plugin/gui*subpaths and optionalelectron/vite/vite-plugin-solidpeers. We import only@opencode/plugin's root.Host.resolvenow reads a local plugin'spackage.json, but we pass plugins as objects, not directories.typesto the pluginctx.event.subscribe. The harness subscribes through the SDK host (opencode.events.subscribe) and still getsserver.connectedfirst, which the event-stream tests confirm.livecheck to the SDK's instance map. No API change.Types.DeepMutable. We don't name it, andModel.Info.default,Model.ID.makeandProvider.ID.make(models/opencode/index.ts:118-124) are unchanged.OpenCodeWorkerd.create({ plugins })now registers plugins before resuming suspended sessions, so a turn resumed on boot seesai.plugin. We had no workaround for the old order.models/opencoderegisters no tool hooks.@opencode/sdk/workerdAPI.zodnor@standard-schema/specthrough the plugin.@opentui/*peer is now exactly0.7.0, which the lockfile resolves.Decisions
^2.0.24. No published source changed. The caret already admits 2.2.x, and our code compiles and passes on both 2.0.24 (before) and 2.2.0 (after). Raising the floor would push users off 2.0.x with no code reason.agentspackage changes only indevDependencies. The other edits are a test config and the example.vite.config.tswithout it:vite buildbundles the chunk fine (Workerindex.js12.8 MB raw, 1.29 MB gzipped), and stubbing it there would change what the deployed example ships. See Needs a maintainer forvite dev.effect@4.0.1, so the oldunstable/httpapipath would match nothing.github-actions[bot]. This PR includes its fixes (the same Scalar path change) and moves to the newer release.Needs a maintainer
vite devhits the same 8 MB module limit. I couldn't run it here: its remoteAIbinding needsCLOUDFLARE_API_TOKEN.@cloudflare/vite-pluginalso loads modules into workerd through a module runner, so it may fail the same way the tests did. Options: add the sameempty-models-dev-snapshotplugin to the example withapply: "serve"(dev only, since the example also setsmodels: { fetch: false }), or leave it. Recommendation: runpnpm startinexamples/next/harnesses/opencodeonce. If it fails with "Message is too large", add the dev-only stub.Affected open PRs
pnpm-lock.yamlonly. It edits other lines ofexamples/next/harnesses/opencode/package.json. Whichever merges second regenerates the lockfile.packages/agents/package.json(theversionfield) and an unrelatedpnpm-lock.yamlhunk (packages/hono-agents). No@opencode/*change.packages/agents/package.json(feat(agents): make @modelcontextprotocol/sdk and /server optional peers #2634, refactor(agents): remove AiSdkHarness; pi Channels adapter and projections in the package #2545, feat(agents): portable harness extensions (agents/harness/extensions) #2511, feat(channels): ACP channel andagents acpstdio bridge #2501, feat(agents): agents/tools/testing toolbox + deployed pi harness OOM/CPU/wall-time e2e #2421, fix(think): drain recovered messenger queues on chat 4.39+ and bump chat to 4.41.1 #2416, feat(payments): wrap functions and MCP tools with x402 #2273, feat(agents): dynamic agents as a real Lifecycle capability #2250, feat(context): bound what a tool result contributes to a request #2203, feat(models): unified createAI provider for Workers AI and AI Gateway (ai-sdk, pi-ai) #2214) don't change@opencode/*pins or the opencode harness. chore(agents): test against opencode 2.1.4 #2692's review checked several of them, and none touch the files changed here exceptpnpm-lock.yaml.Other changes
packages/agents/package.json:54-55: dev pins@opencode/pluginand@opencode/sdk2.0.24→2.2.0.examples/next/harnesses/opencode/package.json:17-18: the same two pins2.0.24→2.2.0.pnpm-lock.yaml: regenerated withpnpm install. Every@opencode/*package resolves to 2.2.0, with no 2.0.24 left. Transitive changes come from opencode's own dependency tree:effect4.0.0-rc.112 → 4.0.1 (plus@effect/opentelemetry/platform-node*4.0.1),@opentui/core0.5.14 → 0.7.0,@opencode-ai/pty0.2.0 → 0.3.1,bun-pty0.4.9 → 0.4.11,gitlab-ai-provider6.19.0 → 6.23.1,openai6.45.0 → 7.19.0 (in opencode's tree).ws@8.22.0,proper-lockfile,retry.msgpackr,msgpackr-extract,fast-check,pure-rand,@modelcontextprotocol/client@2.0.0/core@2.0.0,mime@4.1.0,http-cache-semantics,isomorphic-ws,undici@8.10.2,strip-ansi@7.1.2,node-gyp-build-optional-packages.@openai/agents*,@cloudflare/sandbox,@earendil-works/pi-*,@tanstack/ai-openai/openai-base,drizzle-orm.vite8.1.6/8.3.5 as an optional peer.Evidence
harness-opencode31/31 and workerssrc/tests/models/opencode5/5. On 2.2.0 with only the pins moved,harness-opencoderan 5/14 (events.test.tsonly). The worker exited with "Message is too large", both with the old Scalar path and after fixing it, until the catalog stub was added.harness-opencode31/31 and workerssrc/tests/models/opencode5/5.pnpm run buildpasses for 22 projects, including the OpenCode example'svite build.pnpm run checkpasses: sherif, exports check, oxfmt, oxlint, and typecheck of all 133 projects.Merge Danger
Door: two-way for this PR, since it moves only dev, test and example pins. The example is the exception: deploying
examples/next/harnesses/opencodefrom this commit puts its Durable Objects on opencode 2.2, and per acdcdb8 sessions that compact under 2.1+ may not decode on 2.0.x. Treat that deployment as one-way.Blast Radius: none for published packages: dev dependencies, a test config and the example only.
No one gets a new peer-dependency warning: the
agentspeer range is unchanged.Opened by Gardener's
opencode-upgradetask. Commits pushed by Gardener don't start CI: close and reopen this pull request, or push to it, to run it. Review comments are handled by Gardener'spr-review-fixtask.