Skip to content

fix(web): close SSE on result event to prevent 502 on send - #14

Merged
mariuspruvot merged 1 commit into
mainfrom
fix/result-closes-session
Apr 17, 2026
Merged

fix(web): close SSE on result event to prevent 502 on send#14
mariuspruvot merged 1 commit into
mainfrom
fix/result-closes-session

Conversation

@mariuspruvot

Copy link
Copy Markdown
Owner

Summary

  • Close SSE connection and set status to completed/failed as soon as the stream-json result event arrives
  • Prevents 502 errors when users try to send messages after session completion but before the SSE done event

The result event means Claude is done. The container starts shutting down immediately, but the SSE done event arrives later. In that gap, the input bar was still visible and users got 502s.

Test plan

  • npx tsc --noEmit passes
  • npx vitest run — 53 tests pass
  • Manual: complete a session, verify input bar hides immediately after last response

When the stream-json result event arrives, close the SSE connection
and transition to completed/failed immediately. Previously we waited
for the SSE done event, but the container is already shutting down
by then — user input sent in the gap returned 502.
@helprs-local-mariuspruvot

Copy link
Copy Markdown

helPRs session created for this PR.

Skill: challenge-me | Open session

@mariuspruvot
mariuspruvot merged commit d59f8ee into main Apr 17, 2026
6 of 8 checks passed
@mariuspruvot
mariuspruvot deleted the fix/result-closes-session branch April 17, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant