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
Mid-session crash leaves ordering-dependent terminal status (onclose can downgrade "error" → "disconnected") #1490
Discovered during the #1489 re-review (follow-up to #1323).
On a real mid-session transport crash, many SDK transports fire bothonclose and onerror, in a transport-dependent order. After #1489, the error event (and thus lastError / the toast) surfaces in both orderings — that goal is fully met. But the persistent status the client lands on still differs by ordering:
onerror-then-onclose → final status "disconnected" — the trailing onclose overwrites "error" via the if (this.status !== "disconnected") guard at core/mcp/inspectorClient.ts:432.
onclose-then-onerror → final status "error".
So two transports can leave different steady-state status after an identical crash.
Why it's currently benign
The web UI consumes the crash reason via lastError (always set in both orderings), not status === "error", so the toast fires either way. This is informational today.
When it would matter
If any consumer (web/TUI/CLI) ever branches on status === "error" to render a distinct errored state vs. a clean disconnect, the asymmetry would make that branch transport-dependent.
Possible fix
Don't let onclose downgrade an "error" status — e.g. in the onclose handler treat "error" as terminal (only transition "connected"/"connecting" → "disconnected"), or have the crash path settle on a single canonical terminal status.
Scope note
Out of scope for #1323/#1489 (which only surface the reason). Filing so the property is tracked rather than a future surprise.
Activity
feat(core): surface mid-session transport failures via lastError (#1489)
fix(core): single disconnect event when explicitly disconnecting from…
test(core): deterministically pin the sync-close disconnect double-fi…
fix(core): make "error" the canonical terminal status on a mid-sessio…
refactor(web): reuse isTerminalStatus for card-dim gate (#1521 review)
fix(web): re-enable other server cards when a connection errors (#1521)…