[PR #10588] docs: fix permission event name (permission.asked not permission.updated) #13490

Closed
opened 2026-02-16 18:18:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10588

State: closed
Merged: Yes


Summary

  • Fix incorrect permission event name in plugin documentation

Details

The documentation lists permission.updated as a permission event, but testing shows the actual event name is permission.asked.

Before:

Permission Events
- permission.replied
- permission.updated

After:

Permission Events
- permission.asked
- permission.replied

How this was discovered

Created a plugin that logs all events to debug notification behavior:

event: async ({ event }) => {
  await appendFile("/tmp/debug.log", `${event.type}\n`)
}

When triggering a permission prompt, the log shows:

permission.asked    <- when permission prompt appears
permission.replied  <- when user responds

permission.updated never appears - that event doesn't exist.

Working example

export const NotificationPlugin = async ({ $ }) => {
  return {
    event: async ({ event }) => {
      // This works:
      if (event.type === "permission.asked") {
        await $\`osascript -e 'display notification "Permission required!" with title "OpenCode"'\`
      }
    },
  }
}
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10588 **State:** closed **Merged:** Yes --- ## Summary - Fix incorrect permission event name in plugin documentation ## Details The documentation lists `permission.updated` as a permission event, but testing shows the actual event name is `permission.asked`. **Before:** ``` Permission Events - permission.replied - permission.updated ``` **After:** ``` Permission Events - permission.asked - permission.replied ``` ## How this was discovered Created a plugin that logs all events to debug notification behavior: ```javascript event: async ({ event }) => { await appendFile("/tmp/debug.log", `${event.type}\n`) } ``` When triggering a permission prompt, the log shows: ``` permission.asked <- when permission prompt appears permission.replied <- when user responds ``` `permission.updated` never appears - that event doesn't exist. ## Working example ```javascript export const NotificationPlugin = async ({ $ }) => { return { event: async ({ event }) => { // This works: if (event.type === "permission.asked") { await $\`osascript -e 'display notification "Permission required!" with title "OpenCode"'\` } }, } } ```
yindo added the pull-request label 2026-02-16 18:18:20 -05:00
yindo closed this issue 2026-02-16 18:18:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13490