From 024ec33bf22fb57ce0acb7cbfc1b37eac133bbe4 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 4 Jan 2026 21:39:13 +0100 Subject: [PATCH] docs(coding-agent): fix event bus docs - handlers persist, remove redundant note --- packages/coding-agent/docs/custom-tools.md | 4 +--- packages/coding-agent/docs/hooks.md | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/coding-agent/docs/custom-tools.md b/packages/coding-agent/docs/custom-tools.md index f77cf53f..8511aac9 100644 --- a/packages/coding-agent/docs/custom-tools.md +++ b/packages/coding-agent/docs/custom-tools.md @@ -200,9 +200,7 @@ const unsubscribe = pi.events.on("other:event", (data) => { }); ``` -Events are session-scoped. Use namespaced channel names like `"toolname:event"` to avoid collisions. - -Handler errors (sync and async) are caught and logged. +Event handlers persist across session switches (registered once at tool load time). Use namespaced channel names like `"toolname:event"` to avoid collisions. Handler errors (sync and async) are caught and logged. ### Sending Messages diff --git a/packages/coding-agent/docs/hooks.md b/packages/coding-agent/docs/hooks.md index aadc5db6..91b473b6 100644 --- a/packages/coding-agent/docs/hooks.md +++ b/packages/coding-agent/docs/hooks.md @@ -904,11 +904,7 @@ const unsubscribe = pi.events.on("my:channel", handler); unsubscribe(); ``` -Events are session-scoped (cleared when session ends). Channel names are arbitrary strings - use namespaced names like `"toolname:event"` to avoid collisions. - -Handler errors (sync and async) are caught and logged. - -**Important:** Use `{ triggerTurn: true }` when you want the agent to respond to the event. Without it, the message displays but the agent stays idle. +Event handlers persist across session switches (registered once at hook load time). Channel names are arbitrary strings; use namespaced names like `"toolname:event"` to avoid collisions. Handler errors (sync and async) are caught and logged. ## Examples