Skip to content

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

Closed as duplicate

Description

@USVET11B

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.

Activity

  1. added
    bugSomething isn't working
    duplicateThis issue or pull request already exists
    platform:windowsIssue specifically occurs on Windows
    platform:vscodeIssue specifically occurs in VS Code
    on May 15, 2026
  2. github-actions commented on May 15, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Webview shows literal "Unhandled case: [object Object]" when streaming response ends with had_error=true #59306
    2. [Cowork UI] "Unhandled case: [object Object]" banner — MCP tool-result envelope + SDK stream-end-with-error renderer paths #59139
    3. Unhandled case: [object Object] banner halts agent execution mid-run #59156

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. github-actions commented on May 18, 2026

    @github-actions

    This issue has been automatically closed as a duplicate of #59306.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  4. github-actions commented on Jul 7, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions