fix: surface disconnect reason, switch health probe to /global/health (#978)

- event-pipeline: onDisconnect now carries a reason tag (ws_closed:code=N, ws_error_frame, ws_closed_before_ready, sse_error)
- useConfigStore: store lastDisconnectReason, clear on reconnect
- send guards: embed reason in Connection lost toast so we can tell which path tripped
- lifecycle: isOpenCodeProcessHealthy hits /global/health (healthy flag) with 5s timeout instead of /session with 2s, avoids false restarts under stream load
This commit is contained in:
Bohdan Triapitsyn
2026-04-22 00:33:21 +03:00
committed by GitHub
parent 8e86891d8e
commit 5ec7f46105
6 changed files with 46 additions and 16 deletions
+3 -3
View File
@@ -1347,7 +1347,7 @@ export function SyncProvider(props: {
handleEvent(directory, payload, childStores, routingIndex)
},
onReconnect: () => {
useConfigStore.setState({ isConnected: true })
useConfigStore.setState({ isConnected: true, lastDisconnectReason: null })
for (const [dir, store] of childStores.children) {
if (reconnectResyncing.has(dir)) continue
if (getReconnectCandidateSessionIds(store.getState()).length === 0) continue
@@ -1362,8 +1362,8 @@ export function SyncProvider(props: {
})
}
},
onDisconnect: () => {
useConfigStore.setState({ isConnected: false })
onDisconnect: (reason) => {
useConfigStore.setState({ isConnected: false, lastDisconnectReason: reason })
},
})
return cleanup