Commit 934f492
authored
Clean up handlers and remove bus listeners on v3.close() (#1418)
# why
With many concurrent sessions, memory leaks can crash the node process
# what changed
Ensured handler cleanup as well as removed eventbus listeners when
calling `stagehand.close()`
# test plan
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fully clean up V3 on close to prevent memory leaks and stuck handlers.
We remove event bus listeners and clear local state during teardown.
- **Bug Fixes**
- Remove all event bus listeners on close.
- Reset act/extract/observe handlers and clear history.
- Ensure instance is removed from the global registry.
<sup>Written for commit 6330dde.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->1 parent 8cff9ac commit 934f492
File tree
2 files changed
+16
-0
lines changed- .changeset
- packages/core/lib/v3
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
1377 | 1388 | | |
1378 | 1389 | | |
1379 | 1390 | | |
| |||
0 commit comments