docs: Add filtering subagents notifications to plugin example

pull/15713/head
Tamir Zahavi-Brunner 2026-03-02 14:11:10 +01:00
parent bf2cc3aa2f
commit 526fb0c111
1 changed files with 6 additions and 0 deletions

View File

@ -225,6 +225,12 @@ export const NotificationPlugin = async ({ project, client, $, directory, worktr
event: async ({ event }) => {
// Send notification on session completion
if (event.type === "session.idle") {
// Filter out notifications from subagents
const result = await client.session.get({
path: { id: event.properties.sessionID },
})
if (result.error || result.data.parentID) return
await $`osascript -e 'display notification "Session completed!" with title "opencode"'`
}
},