fix(agent): await subscribed event handlers

This commit is contained in:
Mario Zechner
2026-03-30 14:13:30 +02:00
parent cbe1a8b732
commit 9022a5b5ea
5 changed files with 179 additions and 15 deletions

View File

@@ -28,6 +28,11 @@
- `agent.getSteeringMode()` -> `agent.steeringMode`
- `agent.setFollowUpMode(mode)` -> `agent.followUpMode = mode`
- `agent.getFollowUpMode()` -> `agent.followUpMode`
- `Agent.subscribe()` listeners are now awaited and receive the active `AbortSignal`:
- `agent.subscribe((event) => { ... })` -> `agent.subscribe(async (event, signal) => { ... })`
- `agent_end` is now the final emitted event for a run, but not the idle boundary
- `agent.waitForIdle()`, `agent.prompt(...)`, and `agent.continue()` now settle only after awaited `agent_end` listeners finish
- `agent.state.isStreaming` remains `true` until that settlement completes
## [0.64.0] - 2026-03-29