claude-code - 💡(How to fix) Fix VS Code extension: "Unhandled case: [object Object]" banner when SDK stream errors mid-response

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…

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().

Error Message

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

Root Cause

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().

Code Example

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

---

Unhandled case: [object Object]
View output logs · Troubleshooting resources
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

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 VS Code extension: "Unhandled case: [object Object]" banner when SDK stream errors mid-response