Skip to content

Conversation

@MartinWie
Copy link
Contributor

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"'\`
      }
    },
  }
}

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node rekram1-node merged commit 045c30a into anomalyco:dev Jan 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants