OpenCode V2 runs neither the shell-check nor the guard plugin #134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Location
.opencode/plugins/shellcheck.jsonmainatd317dac, and the main-checkout guard plugin that the review-confirmations-and-guards work adds beside it.Evidence
OpenCode now ships two lines. V1 (
opencode-ai, 1.19.3 on 2026-10-16) runs plugins shaped as a function returning{"tool.execute.after": …}, which is the shapeshellcheck.jsuses. V2 (@opencode/cli, 2.0.32) has a new plugin API:Plugin.define({ id, setup(ctx) }), withctx.tool.hook("execute.before" | "execute.after", …). In V2 the edit tools takepathinstead offilePath, andapply_patchis renamedpatch. V2's migration guide says: "V1 plugin implementations do not run in V2" (sst/opencode,devbranch,services/www/src/docs/content/build/plugins/migrate-v1.mdx).Scenario
On OpenCode V2, an agent writes a shell script, and no shell check runs after the write. Once the guard lands, an agent on V2 can also edit a tracked file in the main checkout while it is on the main branch, and nothing refuses it.
Smallest fix
Add a V2 plugin in the
Plugin.defineshape for each hook, using the V2 tool names and thepathargument, and keep the V1 plugins for 1.x. Then teachscripts/verify-agent-config.shto check the V2 wiring too.