VS Code extension: "Unhandled case: [object Object]" banner when SDK stream errors mid-response

Resolved 💬 3 comments Opened May 15, 2026 by dvass88 Closed May 19, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

When a Claude Code SDK stream terminates with had_error: true mid-response, the VS Code extension renders the error as a raw banner reading Unhandled case: [object Object] instead of a usable error message. The error object is being passed to a switch with no matching case and stringified via toString().

Actual

Banner: Unhandled case: [object Object]. The conversation transcript becomes unrecoverable; only fix is to dismiss and start a fresh session.

Notes

The underlying stream failure may be transient/server-side, but the UI's lack of a fallback case for that error shape is the reportable bug.

What Should Happen?

A human-readable error (e.g. "Stream interrupted — retry?") with a retry affordance, instead of a stringified object.

Error Messages/Logs

From the extension output log at the moment of failure:


[info] log_event sdk_stream_ended_no_result eventData: { had_error: true, subagent_count: 0, message_count: 18 }
[info] update_session_state ... state: idle


No further error detail is surfaced to the user — just `[object Object]`.

UI banner text:


Unhandled case: [object Object]
View output logs · Troubleshooting resources

Steps to Reproduce

  1. Start a new session in VS Code with a long-ish prompt that triggers multiple tool calls.
  2. Wait for the SDK stream to fail mid-response (intermittent — likely needs an upstream 429/529/transport blip).
  3. Banner appears at the top of the conversation:
Unhandled case: [object Object]
View output logs · Troubleshooting resources

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

cc_version=2.1.141.672 (Anthropic.claude-code VS Code extension)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Extension: Anthropic.claude-code (cc_version=2.1.141.672)
  • VS Code on macOS (Darwin 24.4.0)
  • Model: Opus 4.7

View original on GitHub ↗

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