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 after SSE reconnect — missed events not recovered #13947
When the SSE event stream (/global/event) drops and reconnects, the web UI never re-fetches state from the server. Events missed during the disconnect are permanently lost — the session timer keeps running but no new content appears. Only a manual page refresh recovers the UI.
Root cause: applyGlobalEvent in event-reducer.ts ignores server.connected events. After SSE reconnection the client gets a fresh stream but has no idea it missed anything.
Secondary issues:
The 30s heartbeat interval is too slow to detect dead connections through buffering reverse proxies (Tailscale serve, nginx, etc.)
The frontend proxy catch-all hardcodes app.opencode.ai with no way to override it for self-hosted patched frontends
Steps to reproduce
Open the web UI through any reverse proxy (Tailscale serve, nginx, Cloudflare Tunnel) or on a mobile browser
Start an agent session
Wait for the SSE connection to drop (switch WiFi, put phone to background, or proxy idle timeout)
Observe: timer keeps counting but content stops updating
Refresh Chrome → UI shows the completed state that was missed
Also reproducible without a proxy by switching networks mid-session on mobile.
server.ts: read OPENCODE_APP_URL env var in the catch-all route (falls back to app.opencode.ai)
Running both patches in production (opencode web via Tailscale serve, accessed from Android Chrome). UI now recovers within seconds after any connection drop.
Activity