Repository navigation
Replies: 1 comment
|
This is likely the same root cause: the server-side WebSocket heartbeat (2s interval + 2 missed pongs) tears down connections on high-latency networks. Details in #9797. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment
Bug
On mobile browsers, interactive cards (agent questions / approvals) sometimes never appear while the page stays open. They only show up after a manual page refresh. Happens intermittently β typically after the phone locks, the tab goes to background, or the network switches (WiFi <-> cellular).
What I traced in source
Server side is correct: when the agent asks a question it is stored in
pendingQuestions(api-proxy.ts ~line 1388) and pushed as aquestion/requestedframe over the mux WebSocket. On (re)connect the server replays all pending questions (api-proxy.ts ~line 3436) β which is exactly why a refresh makes the card appear.Client side is fragile (
packages/client/connection/src/web-api-client.ts+packages/client/runtime/src/client/sessions/manager.ts):closeevent (handleClose-> enqueue end -> reconnect loop with backoff).visibilitychangelistener to force a reconnect when the tab returns to the foreground.On mobile, browsers silently suspend WebSockets when the screen locks / the tab is backgrounded / the network changes β often without firing
close. The client believes the connection is alive, so every subsequentquestion/requestedframe is lost and no card is rendered. A manual refresh forces a fresh connection, the server replays pending questions, and the card appears.Expected
closeevent.visibilitychange(andonline/offline) handlers that proactively reconnect when the tab becomes visible again β standard practice for mobile web apps.Impact
Remote/mobile users miss agent questions entirely (approval prompts, clarification asks), which can stall a session without the user knowing.
All reactions