Commit be9ec91
Fix: close scope on unexpected process exit to prevent resource leaks
When the codex app-server process exits unexpectedly (not via stopSession),
the onSuccess and onFailure handlers deleted the session from the map but
never closed context.scope. Since the session was removed, stopSession could
never be called for it, permanently leaking the scope and its resources.
Changed both handlers from Effect.sync to Effect.suspend so they can return
a Scope.close effect after performing the sync cleanup work, matching the
cleanup behavior in stopSession.
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>1 parent 870d694 commit be9ec91
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
579 | 579 | | |
580 | | - | |
| 580 | + | |
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
591 | 592 | | |
592 | 593 | | |
593 | | - | |
| 594 | + | |
594 | 595 | | |
595 | | - | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| |||
603 | 604 | | |
604 | 605 | | |
605 | 606 | | |
| 607 | + | |
606 | 608 | | |
607 | 609 | | |
608 | 610 | | |
| |||
0 commit comments