mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 20:01:06 +00:00
docs(coding-agent): fix event bus docs - handlers persist, remove redundant note
This commit is contained in:
parent
99a539baa4
commit
024ec33bf2
2 changed files with 2 additions and 8 deletions
|
|
@ -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.
|
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.
|
||||||
|
|
||||||
Handler errors (sync and async) are caught and logged.
|
|
||||||
|
|
||||||
### Sending Messages
|
### Sending Messages
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -904,11 +904,7 @@ const unsubscribe = pi.events.on("my:channel", handler);
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
```
|
```
|
||||||
|
|
||||||
Events are session-scoped (cleared when session ends). Channel names are arbitrary strings - use namespaced names like `"toolname:event"` to avoid collisions.
|
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.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue