Commit adfa914
bcode
fix(plugin): drop scope-close deregistration of shutdown hooks
Fix 3 from the cubic review on PR #75 was a regression. The plugin-layer scope (under InstanceState) closes BEFORE the top-level finally in src/index.ts runs, via store.dispose(ctx) in effect-cmd's own finally. A scope-close finalizer empties pluginShutdownHooks before the host can iterate it, defeating the entire feature.
Verified live: v0.1.8-rc1 in staging cloud V4 still produced orphan turn parents (trace 0ee0b31c-..., top_span_landed=False, total_cost=0, all session.llm children referencing one unlanded parent span).
Multi-instance TUI mode bloat from accumulated closures is acceptable -- rare in practice, closures are tiny, and the hooks Set is intentionally module-level so it outlives Effect scopes.1 parent 09a7178 commit adfa914
1 file changed
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
285 | 290 | | |
286 | | - | |
287 | | - | |
288 | | - | |
| 291 | + | |
289 | 292 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
| |||
0 commit comments