"Unhandled case: [object Object]" overlay crashes session (correlates with MCP SSE reconnect)

Resolved 💬 3 comments Opened May 15, 2026 by USVET11B Closed May 18, 2026

Version: 2.1.142 (also reproduced in 2.1.141)
OS: Windows 11 Pro 10.0.26200
Surface: VS Code extension

Repro

Recurring frontend crash showing an Unhandled case: [object Object] overlay with a "View output logs · Troubleshooting resources" link. Recurs every ~15 minutes, correlating with SSE MCP reconnect cycles (in my case Apify's 900-second connection timeout).

Log signature

The Claude Code VS Code output panel shows clean Stop hooks completing and a clean SSE disconnect / reconnect cycle from the MCP server, with no API errors. The visible error template [object Object] is the giveaway — a switch / case branch is not stringifying the unhandled value before throwing, so the user sees JavaScript's default Object.toString() instead of useful diagnostic info.

Example from output panel:

MCP server "apify": HTTP connection dropped after 900s uptime
MCP server "apify": Connection error: SSE stream disconnected: TimeoutError: The operation timed out.
MCP server "apify": Terminal connection error 3/3
MCP server "apify": Closing transport (max consecutive terminal errors)
MCP server "apify": HTTP connection closed after 900s (with errors)
MCP server "apify": Cleared connection cache for reconnection

…then the overlay appears.

Workaround

Disable any HTTP-mode MCP server (removed mcpServers.apify from ~/.claude.json). After a VS Code restart the crashes stop. SSE-disconnect handling in the extension still needs the actual fix, though.

Impact

Lost a few hours of productive work to repeated session crashes during a real-time video production session. Each crash kills any background scripts the session has running.

Suggested fix

Wherever the Unhandled case: … error template is constructed, stringify the unhandled value (${JSON.stringify(value)} or a tagged dump) so the error message is actionable. Then handle the SSE-reconnect payload class that's falling through.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗