fix(opencode): support both OpenCode V1 and V2 (#1557) - #1547
Conversation
There was a problem hiding this comment.
💡 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".
c1c6d9d to
67233a2
Compare
There was a problem hiding this comment.
💡 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".
67233a2 to
e4da4da
Compare
There was a problem hiding this comment.
💡 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".
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
.opencode/plugins/, so OpenCode v1 discovers one plugin while the v1 and v2 implementations remain separate helper modules.draft.addAPI./ce-plan add OAuth loginsendstext: "add OAuth login"andskills: [{ id: "ce-plan" }]. Existing prompt attachments are preserved and the selected skill is not duplicated.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.1.18.23- interactive TUI loaded the repository plugin and reached a clean exit (init count=38).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 intests/skills/ce-work-cross-model-routes.test.ts.bun run typecheckandbun run lint- not configured in this repository.Security Disclosure
The plugin reads bundled
SKILL.mdfiles and passes their registered locations and content to OpenCode. No new shell execution, credential handling, permission rules, or dependencies were introduced.Agent Disclosure
OpenCode · openai/gpt-5.6-luna