Repository navigation
chore(agents): test against opencode 2.1.4 - #2692
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.1.4 and regenerate pnpm-lock.yaml. opencode 2.1 moved to Effect 4.0.1, which ships its Scalar UI at effect/dist/http-api/internal/httpApiScalar.js instead of effect/dist/unstable/httpapi/..., so point the Vite stubs in the harness-opencode test config and the OpenCode example at the new path. The peer range (^2.0.24) is unchanged: no source changed, and it already admits 2.1.x. Gardener-Operation: op_601f7a6f63e85f1448ea98c3c8383a84cf595551244888a56c1ea1bdcd358ac5:1ae102655e0bf7e77a090f51aa19bb52bb056b1689181e2c5b9b193ccb855997
|
🔴 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: |
|
Superseded by #2725 |
Summary
Moves the dev and example pins for
agents/harness/opencodeandagents/models/opencodefrom opencode 2.0.24 to 2.1.4, and fixes the Vite stub that Effect 4.0.1 broke.@opencode/sdk(dev pin, example)@opencode/plugin(dev pin, example)^2.0.24^2.0.24(unchanged)opencode has released 2.0.25 to 2.0.32 and 2.1.0 to 2.1.4 since our pin. Our caret peer range
^2.0.24already lets users install every one of them. This PR makes our tests and the example run on 2.1.4.What changed upstream that affects us
unstable/http*modules moved toeffect/httpandeffect/http-api, and the Scalar API-reference script now lives ateffect/dist/http-api/internal/httpApiScalar.js. Our Vite plugins stub that 3 MB script because Vite's import analysis can't parse it, and they matched the old path:packages/agents/src/harness/opencode/tests/vitest.config.ts:16andexamples/next/harnesses/opencode/vite.config.ts:16. With 2.1.4 and the old path,harness-opencodefailed:harness.test.tsdidn't load and all 9table-prefix.test.tstests failed with "Failed to parse source for import analysis… File: …/effect@4.0.1/…/http-api/internal/httpApiScalar.js". The same fix in both files:state/providerState/resultStatetonative, dropsrecentfrom compaction messages andsession.compaction.*events, and replacesproviderContextwithnative.messages. Plugins'SessionCompactionResult.providerStatebecomesnative. 2.1 upgrades rows written by older versions when it reads them (SessionLegacy). It does not rewrite them, but rows it writes no longer carryrecent, which 2.0.24's schema requires. Our code reads none of the renamed fields:events.ts:264-268uses onlyreasonanderror.message.models/opencodedoesn't implement compaction, and typecheck passes. The only effect is on rollback (see Merge Danger).No effect on us (35)
OpenCodeWorkerd.create({ plugins })now registers plugins beforeresumeSuspendedSessionsruns. A turn resumed on boot therefore seesai.plugin, which we pass there. We had no workaround for the old order, so nothing to remove.examples/next/harnesses/opencode/src/workspace.ts:143). They now reach the model as a tool failure, which is what that code intends.models/opencodeusesctx.aisdk.hook).DeepMutablebecomes Effect'sTypes.DeepMutablein editor types. We don't name it, andModel.Info.default/Provider.ID.makeare unchanged.close()still aborts in-flight requests.@opencode/sdk/workerdAPI withoutworkspaceProviders.ensurePluginRuntimereturns{}off Bun).permission.listand reply surface is unchanged.@opencode/plugindropszod/@standard-schema/spec. We import neither through it.@opentui/*peer is now>=0.6.8, which the lockfile resolves.Decisions
^2.0.24. No source file changed. Our code compiles and passes on 2.1.4 and passed on 2.0.24 before this PR, and the caret already admits 2.1.x. Raising the floor would only force users off 2.0.x for no code reason.agentspackage changes only indevDependencies. The other edits are a test config and the example, so users see no difference.effect@4.0.1, and both the test config and the example now pin it. Keeping the oldunstable/httpapipath would match nothing they load.Needs a maintainer
Affected open PRs
pnpm-lock.yamlonly. Itsexamples/next/harnesses/opencode/package.jsonedit is on theviteline, not the@opencode/*lines. Whichever merges second regenerates the lockfile.pnpm-lock.yamlonly. It also editsexamples/next/harnesses/opencode/package.json, on other lines. Whichever merges second regenerates the lockfile.@opencode/*version or opencode harness code. Version Packages #2685, 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): agents/tools/testing toolbox + deployed pi harness OOM/CPU/wall-time e2e #2421 and feat(payments): wrap functions and MCP tools with x402 #2273 touchpackages/agents/package.jsonbut keep@opencode/*at 2.0.24 or don't list it.Other changes
packages/agents/package.json:54-55: dev pins@opencode/pluginand@opencode/sdk2.0.24→2.1.4.examples/next/harnesses/opencode/package.json:17-18: the same two pins2.0.24→2.1.4.pnpm-lock.yaml: regenerated withpnpm install. Every@opencode/*package resolves to 2.1.4, with no 2.0.24 left. Transitive changes come from opencode's own dependencies:effect4.0.0-rc.112 → 4.0.1 and@effect/*4.0.1 for the opencode tree,@opentui/core0.6.8,@opencode-ai/pty0.3.1,bun-pty0.4.11,ws8.22.0. Some packages drop out of opencode's tree (msgpackr,fast-check,pure-rand,@modelcontextprotocol/client@2.0.0), and a few entries (@openai/agents*,@cloudflare/sandbox,@earendil-works/*) change only their peer suffixes.packages/agents/src/harness/opencode/tests/vitest.config.ts:16,examples/next/harnesses/opencode/vite.config.ts:16: stub path fix, see above.Evidence
harness-opencode31/31 and workerssrc/tests/models/opencode5/5. On 2.1.4 with the old stub path,harness-opencodefailed:harness.test.tsdidn't load and 9table-prefix.test.tstests failed, with 5/14 tests passing.harness-opencode31/31, workerssrc/tests/models/opencode5/5.pnpm run build(22 projects, including the OpenCode example'svite build) andpnpm run checkpass: sherif, exports check, oxfmt, oxlint, and typecheck of all 133 projects.Merge Danger
Door: one-way, for objects that run on 2.1. opencode 2.1 doesn't migrate old rows, and reads them fine. But compaction messages and
session.compaction.*events it writes have norecentfield, which 2.0.24's schema requires. Running a session that compacted under 2.1 back on 2.0.x would fail to decode it, and 2.0.x would drop the renamednativereplay data. Merging this PR itself rolls back cleanly: it moves only dev, test and example pins.Blast Radius: none for published packages: dev dependencies, the test config and the example only.
No one gets a new peer-dependency warning: the
agentspeer range is unchanged. Deployingexamples/next/harnesses/opencodefrom this commit puts its Durable Objects on opencode 2.1, and the rollback limit above applies to them.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.