Conversation
The plugin SDK types ctx.ask() as returning Effect.Effect<void>, not Promise<void>. Awaiting an Effect object directly is a no-op — the permission prompt was never triggered. Fix by importing effect as a peer/dev dependency and running the Effect via Effect.runPromise(). Update types.ts to match the real SDK type and fix test mocks to return Effect.void instead of a resolved Promise.
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.
Root Cause
OpenCode PR #21986 (merged April 10, 2026, commit
bfef334b) deliberately changedToolContext.askin the plugin SDK from returningPromise<void>toEffect.Effect<void>:This broke the previous fix from commit
9e92eb3(April 1, 2026), which usedawait context.ask(...)and worked correctly at the time. After the opencode change,await-ing an Effect object is a no-op — the Effect is never executed, so the permission prompt was silently skipped.Fix
Add
effectas a peer dependency (it is always present in the process since the plugin runs inside opencode) and a dev dependency for local type checking. UseEffect.runPromise()to bridge the Effect into the async/await context of the plugin'sexecutefunctions.The
askcall is centralised in thewrap()decorator inplugin.tsso all five tools get permission enforcement without duplicating the call in each handler.Changes
package.json: addeffect >=3.0.0as peer + dev dependencysrc/types.ts: fix localToolContext.asktype to match real SDK (Effect.Effect<void>)src/plugin.ts: useEffect.runPromise(ctx.ask(...))in thewrap()decorator; importEffectfromeffecttest/e2e/plugin.test.ts: updatecreateMockToolContext()helper; mockaskreturnsEffect.voidinstead of a resolved Promise