You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web UI freezes mid-session when the event stream dies silently; only a page refresh recovers #39352
Very often the web UI gets stuck mid-session: the spinner keeps spinning on the last line (e.g. a tool header like "Thinking WHOIS:") but nothing new ever arrives. Refreshing the page shows the run actually finished long ago — I've waited 20 minutes on a session that had completed 19 minutes earlier. Without a refresh it never recovers.
Environment
opencode 1.18.5, opencode web --port 4096
Browser on Windows, server inside WSL2 (so the connection crosses the Windows/WSL2 boundary, which is prone to silently killing idle sockets)
Root cause
Two problems stack:
The SSE consumer reads the event stream with no liveness check. If the socket dies without a FIN/RST (NAT/proxy eviction, suspend), reader.read() just never resolves — no error, so the reconnect loop in server-sdk.tsx never re-enters. The server's heartbeats can't help: on v2 they're SSE comment frames (: heartbeat), which the parser discards without yielding an event, so the app literally cannot see them.
Even when a reconnect does happen, nothing repairs the drift. session_status is only written by session.execution.* events, so a run that finished during the outage stays busy forever, and the active-sessions refetch on server.connected is gated on the query having no data — i.e. it only ever fires on the first connect.
#13947 fixed the missed-events-after-reconnect case, but that only helps when the client notices the disconnect. Here the stream dies silently, so there's no reconnect at all — and the status/timeline drift isn't reconciled either way.
This issue might be a duplicate of an existing issue. Please check:
Mobile browser tab does not reconnect SSE stream after returning from another app #39030: Also reports the web UI SSE stream not reconnecting and the chat freezing until a manual page refresh, with the same file (server-sdk.tsx) identified as the fix location. The trigger differs (mobile tab backgrounding vs. silent socket death on WSL2/NAT), but the symptoms and affected code overlap significantly.
If your issue is distinct enough to warrant a separate fix (e.g., the heartbeat-visibility gap and status-drift reconciliation you describe), feel free to keep this open and note the difference.
Activity
github-actions commentedon Jul 28, 2026
This issue might be a duplicate of an existing issue. Please check:
server-sdk.tsx) identified as the fix location. The trigger differs (mobile tab backgrounding vs. silent socket death on WSL2/NAT), but the symptoms and affected code overlap significantly.If your issue is distinct enough to warrant a separate fix (e.g., the heartbeat-visibility gap and status-drift reconciliation you describe), feel free to keep this open and note the difference.
github-actions commentedon Sep 27, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.