Files
Cursor AgentandJulius Marminge be9ec914b2 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 <[email protected]>
2026-03-06 00:24:24 +00:00
..