Unhandled case: [object Object] on stream end with had_error: true after long sessions

Resolved 💬 13 comments Opened May 14, 2026 by Maseschine Closed May 15, 2026

What happened

Mid-response in a long-running VS Code conversation, the UI shows
"Unhandled case: [object Object]" in a red error bar. The session
becomes unresponsive (Thinking... never resolves). Sometimes typing
"continue" recovers, sometimes not — it's a gamble.

Reproduction (consistent pattern in logs)

  1. Long-running conversation (40+ messages, multiple large MCP

tool results — 90KB+ persisted read-results in my case)

  1. Tool call completes successfully
  2. Follow-up API request sent
  3. Stream starts, delivers a few hundred bytes
  4. Stream stalls for 15s with no further chunks
  5. sdk_stream_ended_no_result fires with had_error: true
  6. UI surfaces "Unhandled case: [object Object]"

Log excerpt

[Stall] tool_dispatch_end tool=mcp__JARVISVault__list_directory outcome=ok durationMs=4
[API REQUEST] /v1/messages source=sdk
Stream started - received first chunk
[WARN] [Stall] stream_idle_partial lastChunkAgeMs=15010 bytesTotal=669
log_event sdk_stream_ended_no_result {"had_error":true,"message_count":41}

Expected

Either:

  • Automatic retry of the failed stream, OR
  • A user-facing error with a "Retry" / "Resume" button, OR
  • At minimum, a meaningful error message instead of [object Object]

Environment

  • Extension version: 2.1.141.672 (also reproduced on 2.1.141.752)
  • VS Code on Windows 11
  • Model: Opus 4.7 (1M context)
  • MCP servers active: ~20 (heavy MCP usage)

Impact

In long content-heavy sessions (vault analysis, document audits, etc.)
this fires multiple times per hour. The workflow becomes a gamble of
"does retry work this time".

View original on GitHub ↗

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