Repository navigation
Conversation
AleMuzzi
force-pushed
the
feat/opencode-v2-port
branch
from
November 5, 2026 16:13
ac74314 to
d75db24
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the CrewBee plugin adapter to the OpenCode V2 plugin API so the plugin loads on OpenCode 2.x, while keeping the V1 path working through a dual-shape entrypoint.
On OpenCode V2 (tested with 2.1.3) the current release fails to load with:
V2 does not run V1 plugin implementations (see the official migration guide), so the adapter is provided as a new V2 module alongside the preserved V1 implementation.
Changes
src/adapters/opencode/v2/(new): V2 adapter implementationplugin.ts—Plugin.define({ id, setup(ctx) })entrypoint wiring transforms, hooks, and event subscriptionsession-client.ts— V2 session/message client shims (messages viasession.context, prompt, abort → interrupt)tool-registration.ts— registers delegate tools throughctx.tool.transformwith zodValueSchemaagent-definition.ts— projects CrewBee agents viactx.agent.transformmodels.ts— available-model discovery viactx.model.list()permissions.ts— permission mapping for V2 agent definitionslogging.ts— console-based logging (V2 has noclient.app.log)src/adapters/opencode/plugin.ts— dual-shape default export: V2setup+ V1serversrc/adapters/opencode/plugin-v1.ts— previous V1 plugin body preserved asserver()src/adapters/opencode/tool-hooks.ts—execute.before/execute.afteradapted to V2 hook shapessrc/install/opencode-config-file.ts— plugin entry written to V2pluginsconfig key (withpluginmigration)src/update/refresh.ts— V2 logging/context adaptationpackage.json— targets OpenCode 2.2.0 SDK (@opencode/plugin)docs/developer/opencode-v2-port.md— full porting notes (V1 → V2 API mapping)Testing
npm run typecheck,npm run build,npm test