Description
The permission.ask plugin hook is still declared in the public Hooks type, but it has not been invoked anywhere since v1.3.0 (removed March 2026). Plugins that register it load cleanly, typecheck, and silently never fire — nothing warns, nothing errors.
This is not hypothetical: we had a sound-notification plugin that registered permission.ask to chime on permission prompts. After upgrading it became a silent no-op, and an agent sat waiting on a permission prompt unnoticed for an hour.
Evidence
The hook is declared, never called:
- Declared at
packages/plugin/src/index.ts (line 261, dev):
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>
rg '"permission\.ask"' across packages/ at both v1.18.29 and dev shows zero call sites — only the declaration.
It used to work:
- At
v1.1.53, packages/opencode/src/permission/index.ts called:
await Plugin.trigger("permission.ask", info, { status: "ask" })
Removal history (between v1.1.53 and v1.3.0):
f015154314 — refactor(permission): effectify PermissionNext (refactor(permission): effectify PermissionNext + fix InstanceState ALS bug #17511, 2026-03-14): last version containing the trigger
2fc06c5a17 — chore(permission): delete legacy permission module (chore(permission): delete legacy permission module #17534, 2026-03-15): module deleted
v1.3.0 — first release without the invocation
Stale references that keep plugin authors writing dead handlers:
Repro
- Create a plugin:
~/.config/opencode/plugin/x.ts
import type { Plugin } from "@opencode-ai/plugin"
export default (async () => {
return {
"permission.ask": async (input, output) => {
console.log("NEVER FIRES")
},
}
}) satisfies Plugin
- Run any command that triggers a permission prompt (e.g.
bash set to ask).
- The handler is never invoked. Meanwhile the bus event
permission.asked fires normally (same flow the TUI renders).
Expected
Either:
- Remove
"permission.ask" from the Hooks type (and from the bundled customize-opencode skill), so plugin authors aren't led into a silent no-op, or
- Re-wire the hook if it's still intended as an interception point.
Either way, the skill should point plugin authors at the replacement: reacting to the permission.asked bus event via the event hook.
Environment
- opencode
v1.18.29 (verified broken; broken since v1.3.0)
- macOS (darwin)