Skip to content

Complete OpenCode v2 support while preserving V1 compatibility - #10

Merged
ndom91 merged 3 commits into
mainfrom
opencode-v2-support
Oct 17, 2026
Merged

ndom91 merged 3 commits into
mainfrom
opencode-v2-support

Conversation

@ndom91

@ndom91 ndom91 commented Oct 17, 2026

Copy link
Copy Markdown
Owner

This supersedes #8 and completes OpenCode v2 support on top of current main.

What changed

  • Adds OpenCode v2 plugin definitions via server.js (package installs) and index.js (local-directory fallback).
  • Retains the V1 default plugin function and named OpenPlanAnnotatorPlugin export.
  • Removes the @opencode/plugin runtime dependency; V2 accepts the plain { id, setup } definition.
  • Uses the V2 context hook’s supplied agent rather than performing session lookups.
  • Simplifies agent-list handling and removes duplicate approval instructions.
  • Adds V1/V2 entrypoint and behavior coverage.
  • Ensures both V2 entrypoints are included in published packages.

Validation

  • bun test — 109 passing
  • bun run typecheck
  • bun run lint
  • bun run pack:check
  • Smoke-tested with OpenCode v2.0.26 loading the plugin from a local project.

Shadrous and others added 3 commits October 17, 2026 12:46
- Replace V1 function export with Plugin.define({id, setup})
- Register annotate_plan via ctx.tool.transform with JSON Schema input
- Inject plan instructions via ctx.session.hook(context)
- Resolve current agent via ctx.session.get + ctx.agent.list
- Handoff via ctx.session.switchAgent; cleanup via setup return
- Preserve bridge/config/server UI logic unchanged
@ndom91
ndom91 merged commit 79f291b into main Oct 17, 2026
1 check passed
@ndom91
ndom91 deleted the opencode-v2-support branch October 17, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants