Skip to content

Web UI freezes mid-session when the event stream dies silently; only a page refresh recovers #39352

Closed as not planned

Description

@Luppa90

Description

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:

  1. 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.

  2. 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.

Fix incoming.

Activity

  1. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

    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.

  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions