Skip to content

fix(opencode): support both OpenCode V1 and V2 (#1557) - #1547

Open
ucirello wants to merge 1 commit into
EveryInc:mainfrom
ucirello:fix/opencode-v1-v2-plugin
Open

fix(opencode): support both OpenCode V1 and V2 (#1557)#1547
ucirello wants to merge 1 commit into
EveryInc:mainfrom
ucirello:fix/opencode-v1-v2-plugin

Conversation

@ucirello

@ucirello ucirello commented Aug 26, 2026

Copy link
Copy Markdown

Summary

The same plugin declaration now supports OpenCode V1 and V2. In OpenCode v2, slash commands attach the selected skill natively and pass command arguments as prompt text, instead of asking the model to issue a separate Load and execute... request.

Fixes #1557: Expand support for both OpenCode v1 and v2.

Design Decisions

  • The top-level JavaScript entrypoint stays directly under .opencode/plugins/, so OpenCode v1 discovers one plugin while the v1 and v2 implementations remain separate helper modules.
  • The v1 config hook adds the bundled skills path and creates slash-command wrappers.
  • The v2 setup registers skill definitions through the current draft.add API.
  • A v2 command such as /ce-plan add OAuth login sends text: "add OAuth login" and skills: [{ id: "ce-plan" }]. Existing prompt attachments are preserved and the selected skill is not duplicated.
  • Skill frontmatter is removed before registration while the skill's real location is retained, so OpenCode can resolve supporting files relative to the skill.
  • Skills marked non-user-invocable do not receive slash commands.

New concepts

Native v2 skill attachments

OpenCode v2 can attach a skill by ID when submitting a prompt. OpenCode then loads the skill content and supporting files from the registered skill location. This keeps the user request separate from the skill instructions and avoids a model-mediated skill-loading turn. Use this pattern when a command is a thin entry point to a registered skill. It is not a copy of the skill body into a command template.

Validation

  • bun test tests/opencode-plugin-commands.test.ts - 8 passed.
  • bun run release:validate - passed.
  • bun run plugin:validate - passed.
  • git diff --check - passed.
  • OpenCode v1 1.18.23 - interactive TUI loaded the repository plugin and reached a clean exit (init count=38).
  • OpenCode v2 0.0.0-beta-18314 - standalone startup loaded the repository plugin and reached the interactive TUI; native skill-command behavior was manually verified.
  • bun run test - not completed within 420 seconds; it remained in tests/skills/ce-work-cross-model-routes.test.ts.
  • bun run typecheck and bun run lint - not configured in this repository.

Security Disclosure

The plugin reads bundled SKILL.md files and passes their registered locations and content to OpenCode. No new shell execution, credential handling, permission rules, or dependencies were introduced.

Agent Disclosure

  • Model: OpenCode · openai/gpt-5.6-luna

@ucirello ucirello changed the title DNR: fix(opencode): support v1 and v2 plugin loading fix(opencode): support v1 and v2 plugin loading Aug 26, 2026
@ucirello
ucirello marked this pull request as ready for review August 26, 2026 23:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2c46d5c50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .opencode/plugins/compound-engineering.js Outdated
@ucirello ucirello changed the title fix(opencode): support v1 and v2 plugin loading fix(opencode): expose skills through v1 and v2 plugin APIs Aug 26, 2026
@ucirello
ucirello force-pushed the fix/opencode-v1-v2-plugin branch 2 times, most recently from c1c6d9d to 67233a2 Compare August 27, 2026 14:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67233a2561

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .opencode/plugins/compound-engineering/opencode-v2.js Outdated
@ucirello ucirello changed the title fix(opencode): expose skills through v1 and v2 plugin APIs fix(opencode): support both OpenCode V1 and V2 (#1557) Aug 27, 2026
@ucirello
ucirello force-pushed the fix/opencode-v1-v2-plugin branch from 67233a2 to e4da4da Compare August 27, 2026 15:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4da4da52e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .opencode/plugins/compound-engineering/opencode-v2.js
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.

Expand support for both OpenCode v1 and v2

1 participant