Skip to content

chore(agents): test against opencode 2.1.4 - #2692

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
gardener/upstream/opencode-2.1.4
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
gardener/upstream/opencode-2.1.4

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves the dev and example pins for agents/harness/opencode and agents/models/opencode from opencode 2.0.24 to 2.1.4, and fixes the Vite stub that Effect 4.0.1 broke.

Package From To
@opencode/sdk (dev pin, example) 2.0.24 2.1.4
@opencode/plugin (dev pin, example) 2.0.24 2.1.4
peer range ^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.24 already 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

  • high · breaking: "chore: upgrade Effect to rc.118" (1aae67e) and "chore: upgrade Effect to 4.0.1" (41b03de). Effect's unstable/http* modules moved to effect/http and effect/http-api, and the Scalar API-reference script now lives at effect/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:16 and examples/next/harnesses/opencode/vite.config.ts:16. With 2.1.4 and the old path, harness-opencode failed: harness.test.ts didn't load and all 9 table-prefix.test.ts tests 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:
    -        id.includes("/effect/dist/unstable/httpapi/internal/httpApiScalar.js")
    +        id.includes("/effect/dist/http-api/internal/httpApiScalar.js")
  • low · breaking (stored data, no code change): "refactor: v2.1 minor breaking changes" (acdcdb8). The stored session schema renames state/providerState/resultState to native, drops recent from compaction messages and session.compaction.* events, and replaces providerContext with native.messages. Plugins' SessionCompactionResult.providerState becomes native. 2.1 upgrades rows written by older versions when it reads them (SessionLegacy). It does not rewrite them, but rows it writes no longer carry recent, which 2.0.24's schema requires. Our code reads none of the renamed fields: events.ts:264-268 uses only reason and error.message. models/opencode doesn't implement compaction, and typecheck passes. The only effect is on rollback (see Merge Danger).
No effect on us (35)
  • "release: v2.1.4" (68bc26b): version bump.
  • "sync release versions for v2.0.24 … v2.1.3", 13 commits (bd55d48, 62e087f, 8059cdc, 03cb9b9, c5aabae, 34d8ded, f40dc43, 83c5abb, 4e95dac, d30e990, 133b1eb, 4b50f5c, e965774): version numbers only.
  • "feat(sdk): seed host plugins before recovery and harden workerd defaults" (55dde88): OpenCodeWorkerd.create({ plugins }) now registers plugins before resumeSuspendedSessions runs. A turn resumed on boot therefore sees ai.plugin, which we pass there. We had no workaround for the old order, so nothing to remove.
  • "fix(plugin): return Promise tool throws as tool failures" (1438073): the example's tools already throw to report failure (examples/next/harnesses/opencode/src/workspace.ts:143). They now reach the model as a tool failure, which is what that code intends.
  • "fix(plugin): keep each Promise hook rejection on its own tool call" (7351718): none of our plugins register tool hooks (models/opencode uses ctx.aisdk.hook).
  • "refactor: remove redundant casts and duplicate helpers across sdk, plugin, codemode, and schema" (7a62a46): DeepMutable becomes Effect's Types.DeepMutable in editor types. We don't name it, and Model.Info.default / Provider.ID.make are unchanged.
  • "fix(sdk): release completed embedded request signals" (9ee97d8): internal fetch bookkeeping. close() still aborts in-flight requests.
  • "fix(core): route file overrides through Workspace.connect" (c50e39b): adds Effect-entry exports. We use the Promise @opencode/sdk/workerd API without workspaceProviders.
  • "fix(cli): give plugins the host's Effect" (c28e9ec): Bun-only runtime loader (ensurePluginRuntime returns {} off Bun).
  • "feat(plugin): let plugins assert permissions" (6a7cedc): new plugin API. The harness's permission.list and reply surface is unchanged.
  • "feat(plugin): expose session list" (bc5fa1c): new plugin-context method, unused.
  • "feat(plugin): expose credential.activate to server plugins" (d782675): unused.
  • "feat(integration): add declarative external connection method" (70c6c8c): unused.
  • "chore: remove unused dependencies from V2 packages" (50ae4bd): @opencode/plugin drops zod/@standard-schema/spec. We import neither through it.
  • "chore: upgrade opentui v0.6.8", "chore: OpenTUI 0.6.5", "chore(tui): revert OpenTUI 0.6 upgrade", "chore(tui): upgrade OpenTUI to 0.6.2", "chore: upgrade opentui v0.5.17", "chore: upgrade opentui v0.5.16" (c9c1dc0, c7ddff7, def5d94, 65f8907, da40b8f, fcad131): TUI only. The plugin's optional @opentui/* peer is now >=0.6.8, which the lockfile resolves.
  • "feat(tui): report pending session status to the terminal" (d0a2ce3): TUI only.
  • "chore: use bun check for local typechecks and TypeScript 7.1 in CI", "chore: upgrade typecheck to TypeScript 7.0.2", "chore(ci): speed up and stabilize the test workflow" (84578e1, 23359e9, 17229d2): upstream tooling.

Decisions

  • Peer range stays ^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.
  • No changeset. The published agents package changes only in devDependencies. The other edits are a test config and the example, so users see no difference.
  • Stub matches only Effect 4.0.1's path. opencode 2.1.4 resolves only effect@4.0.1, and both the test config and the example now pin it. Keeping the old unstable/httpapi path would match nothing they load.

Needs a maintainer

  • Whether to warn users that moving OpenCode to 2.1 can't be rolled back. This PR doesn't change what users can install. Options: a note in the harness docs or README, or nothing. Recommendation: nothing here. It is upstream's storage change, users opt in by bumping their own pin, and we ship no OpenCode doc page to put it on.

Affected open PRs

Other changes

  • packages/agents/package.json:54-55: dev pins @opencode/plugin and @opencode/sdk 2.0.24 → 2.1.4.
  • examples/next/harnesses/opencode/package.json:17-18: the same two pins 2.0.24 → 2.1.4.
  • pnpm-lock.yaml: regenerated with pnpm install. Every @opencode/* package resolves to 2.1.4, with no 2.0.24 left. Transitive changes come from opencode's own dependencies: effect 4.0.0-rc.112 → 4.0.1 and @effect/* 4.0.1 for the opencode tree, @opentui/core 0.6.8, @opencode-ai/pty 0.3.1, bun-pty 0.4.11, ws 8.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

  • Before: on 2.0.24, harness-opencode 31/31 and workers src/tests/models/opencode 5/5. On 2.1.4 with the old stub path, harness-opencode failed: harness.test.ts didn't load and 9 table-prefix.test.ts tests failed, with 5/14 tests passing.
  • After: harness-opencode 31/31, workers src/tests/models/opencode 5/5. pnpm run build (22 projects, including the OpenCode example's vite build) and pnpm run check pass: 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 no recent field, 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 renamed native replay 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 agents peer range is unchanged. Deploying examples/next/harnesses/opencode from this commit puts its Durable Objects on opencode 2.1, and the rollback limit above applies to them.


Opened by Gardener's opencode-upgrade task. 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's pr-review-fix task.


Devin Review

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
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Oct 23, 2026
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a8ac8de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@scuffi scuffi closed this Oct 23, 2026
@scuffi scuffi reopened this Oct 23, 2026
@agent-think

agent-think Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

🔴 agents import sizes: 1 entry point over threshold

Entry point Exports Largest gzip change Size now
🔴 agents/models/opencode 2 resized up to +7.4 KiB (+7.12%) 111.6 KiB
Changed exports (2)
Import Gzip change Size now
🔴 agents/models/opencode#CLOUDFLARE_PROVIDER_ID +7.4 KiB (+7.12%) 111.6 KiB
🔴 agents/models/opencode#createAI +7.4 KiB (+5.84%) 133.9 KiB
How this works

Each 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 5b49ccc7 → a8ac8de9 · workflow run · reported by agent-think[bot]

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2692

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2692

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2692

hono-agents

npm i https://pkg.pr.new/hono-agents@2692

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2692

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2692

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2692

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2692

commit: a8ac8de

@github-actions

Copy link
Copy Markdown
Contributor Author

Superseded by #2725

@github-actions github-actions Bot closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant