claude-code - 💡(How to fix) Fix "Unhandled case: [object Object]" overlay crashes session (correlates with MCP SSE reconnect)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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

Fix Action

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.

Code Example

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
RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix "Unhandled case: [object Object]" overlay crashes session (correlates with MCP SSE reconnect)