Opus 4.7 1M via Bedrock: VSCode extension stream ends with 0 events; fallback renders as "Unhandled case: [object Object]"
Resolved 💬 48 comments Opened Apr 22, 2026 by armaansengupta-neuralink Closed Jun 24, 2026
Environment
- Claude Code VSCode extension:
2.1.114.c47 - Model:
global.anthropic.claude-opus-4-7(1M context profile) via AWS Bedrock - Platform: macOS (Darwin 25.3.0)
- CLI works fine on the same account/model; this only reproduces in the VSCode GUI
Symptom
After a number of turns with tool use (message_count: 556 in the failing session), the assistant stops responding. GUI shows:
Unhandled case: [object Object] <img width="589" height="68" alt="Image" src="https://github.com/user-attachments/assets/b27c051a-5aca-46df-9cf8-a05d0ab90367" />
Logs
Streaming request opens, Bedrock closes it with zero events:
[DEBUG] [API REQUEST] /model/global.anthropic.claude-opus-4-7/invoke-with-response-stream source=sdk
[DEBUG] Stream started - received first chunk
sdk_stream_ended_no_result { had_error: true, message_count: 556 }
[ERROR] Stream completed without receiving message_start event - triggering non-streaming fallback
[ERROR] Error streaming, falling back to non-streaming mode: Stream ended without receiving any events
Non-streaming fallback fires and also fails — the resulting error is passed to the UI error handler which stringifies it as [object Object].
Repro
- Bedrock account with 1M context access on
global.anthropic.claude-opus-4-7 - Long session (hundreds of turns) using deferred tools (TaskCreate/TaskUpdate/TaskList)
- Eventually the stream closes with 0 events and the fallback dies
48 Comments
I am also seeing this issue using Claude Code via Bedrock
I have the same issue:
Claude Code v2.1.117
API provider: Amazon Bedrock
Model: global.anthropic.claude-opus-4-7[1m]
Adding to the frustration of this extremely annoying bug:
When this
Unhandled case: [object Object]error occurs, if you close Claude Code and reopen the session, the UI truncates the entire conversation back to the moment the error happened — everything you did after the error simply vanishes from the interface.The really painful part: the
.jsonlsession file on disk still contains the full history. All the messages, tool calls, edits, and reads that happened after the error are persisted correctly. But on reload:So if you decided to push through the error and keep working (which is often the only practical choice mid-task), you effectively lose all that progress from the agent's perspective the moment you restart. The data is right there in the JSONL — the UI/agent just refuses to load past the error boundary.
This turns a recoverable hiccup into a hard context wipe, and it makes long planning/implementation sessions (like the one in the screenshots, where significant work was done after the error) extremely risky to resume.
Reproducing on extension 2.1.120 (current latest as of 2026-04-26) on Darwin 25.4.0 with model
global.anthropic.claude-opus-4-7[1m]. Happens frequently in long tool-heavy sessions.Quick diagnosis by grepping the shipped extension:
The message is thrown from function
XB1inside a switch over stream event types:Two problems:
defaultbranch throws on any unknown event type instead of no-oping. Any new stream event the server introduces (or any event that survives thesdk_stream_ended_no_resultfallback path in a shape the switch doesn't recognise) crashes the webview handler.${$}stringifies the event object as[object Object], so the notification is uninformative. Should beJSON.stringify($)at minimum, ideally with the event type extracted.Suggested fix: the default branch should log-and-ignore (with the full event JSON) rather than throw. That preserves forward compatibility when new event types land, and when a genuine bug does occur the notification actually tells you what event was unhandled.
Still repros on 2.1.120 — bumping so it's visible against the latest release.
i'm running into the same issue. basically i cannot use opus 4.7 with bedrock at the moment.
This bug is super annoying and i have to type multiple times "please continue" in VS code extension. That's crazy.
Still reproducing on v2.1.131
Same issue persisting with AWS Bedrock Opus 4.7 on Cursor v3.3.12
Reproducing on
2.1.128.b51(VSCode stable, macOS 15.x arm64, Bedrockus.anthropic.claude-opus-4-71M context). Adding one data point for this specific bundle and notes from a local patch test.Confirmation on 2.1.128
Same symptom and same log trail as the OP. In one day on a normal-sized project I saw 11
sdk_stream_ended_no_resultevents withhad_error: true, each paired withStream completed without receiving message_start event - triggering non-streaming fallback. Context at failure was not the culprit (~242K tokens, effectiveWindow=980000).The throw function is still there in 2.1.128 — same shape as @aumanjoa found in 2.1.120, just with a different mangled name (
GB1instead ofXB1). Two call sites, both inwebview/index.js:QB1.processStreamEvent—default: GB1($)after the six knownmessage_*/content_block_*cases.b20(content-block-delta dispatcher) —default: GB1(J)aftertext_delta,citations_delta,input_json_delta,thinking_delta,signature_delta,compaction_delta.Local patch test (confirms diagnosis)
I replaced the
GB1body fromto
After reloading the VSCode window:
So both behaviors the community has asked for are achievable with a one-function change:
JSON.stringify(value)orvalue?.type ?? "unknown"in the message, per @aumanjoa's suggestion.Extra observation
@pllanos-entropy's note about the
.jsonlfile keeping full history while the UI truncates to the error point is confirmed on my side too. When a session froze mid-tool-dispatch, the disk session had another ~40 messages past the UI boundary on reload — so the lost-context cost is even higher than the toast suggests.Seeing the same issue since yesterday on the VSCode extension.
Environment:
Claude Code: 2.1.132
VSCode extension: anthropic.claude-code 2.1.132
Model: global.anthropic.claude-opus-4-7[1m]
Provider: AWS Bedrock
OS: Linux 6.8.0-111-generic (Ubuntu)
Crash occurs irregularly and at one time it occurred during the first interaction in a session. Same "Unhandled case: [object Object]" error text.
For anyone wanting to mitigate locally while this is fixed upstream — here's a version-agnostic patch script that works across 2.1.120 / 2.1.128 / 2.1.131 / 2.1.132 and should survive through whatever the next minified function name is. macOS and Linux covered; Cursor users just point
EXT_ROOTat their own extensions dir.Patch (run once, then Reload Window)
Revert
What it does (and does not) fix
Unhandled case: [object Object]red toast and the session freeze that comes with it. Tested on 2.1.128; regex is generic to the minified signature so it should match current-gen builds until Anthropic refactors the function.Caveats
EXT_ROOTto that editor's extensions directory (e.g.~/.cursor/extensions).Version 2.1.141 continues to experience persistent issues.
VS Code Extension 2.1.141. Super annoying.
<img width="240" height="199" alt="Image" src="https://github.com/user-attachments/assets/40d737ca-d4ba-48c7-96fb-e1322d6b6208" />
<img width="692" height="170" alt="Image" src="https://github.com/user-attachments/assets/36c63f9f-9a80-440f-83c1-3ce6d04013ab" />
I have the same issue
This issue is occurring using Claude directly without Bedrock too.
Have the same issue.
VSCODE:
Claude Code for VS Code:
This is an issue with VS Code Extension Version: 2.1.141.
I downgraded to VS Code Extension Version: 2.1.140 and restarted VS Code (unchecked auto update in the extension) and it works again for me. Still testing but try downgrading.
The fix is to: go in VSCode Claude Code Extension, Downgrade it to 2.1.140, uncheck auto update the extension and restart VS Code.
Same issue:
Claude Code for VSCODE
Version: 2.1.141
Same issue:
Claude Code for VSCODE
Version: 2.1.141
Come on team we need this fixed. I'm on Claude Code Max and can't have these trivial errors
V2.1.141
<img width="345" height="73" alt="Image" src="https://github.com/user-attachments/assets/90798b3a-358c-44d4-99b6-580a82573777" />
Same issue:
Claude Code for VSCODE
Version: 2.1.141
same. how to fix that?
Experiencing the same error here
claude code 2.1.141
@ziago @yevhenlisovenko @Fl0rencess720 @goneale @Mr-KIDBK @sperokubo check my comment: https://github.com/anthropics/claude-code/issues/52151#issuecomment-4448083216
The fix is to: go in VSCode Claude Code Extension, Downgrade it to 2.1.140, uncheck auto update the extension and restart VS Code.
Same issue:
Claude Code for VSCODE
Version: 2.1.141
The fix works also when downgrading to 2.1.139
Same issue
Same
Unhandled case: [object Object]UI error, but with a different repro than OP — worth flagging since it's not a long-session issue here.Env: VS Code extension 2.1.141, Windows 11, OAuth (claude.ai), model
claude-opus-4-7[1m]withclaude-haiku-4-5sub-agents. No VPN/proxy.Repro: brand-new sessions, fails within the first few turns (
message_count~100–125, not 556).Log pattern — streaming stalls after the first chunk:
[DEBUG] Stream started - received first chunk[WARN] [Stall] stream_idle_partial lastChunkAgeMs=15000 bytesTotal=702[WARN] Streaming stall detected: 39.7s gap between events[INFO] sdk_stream_ended_no_result {"had_error":true,"message_count":125}Often correlated with a malformed tool-input from the
Exploresub-agent right before the stall:[ERROR] SyntaxError: JSON Parse error: Unexpected token '.'[DEBUG] Read tool input error: required parameter file_pathis missingRepros more often when a turn dispatches
Explore(many parallel Glob/Grep/Read via Haiku). Load-correlated, not deterministic — retry sometimes works.UI fix suggestion regardless of root cause: stringify the fallback error properly (
error?.message ?? error?.toString()) so users see something actionable instead of[object Object].Since today, I have the same looking error on Windows 11, Sonnet 4.6 or Opus 4.7), direct API (not Bedrock), session of ~70 turns
Same thing, from VSCode addon, just from today onward I kept getting this error.
same here, VS Code plugin
Confirming 2.1.141 broken, 2.1.140 fixes it on Windows 11 + claude.ai OAuth (not Bedrock).
Environment: VS Code 1.120.0 / Windows 11 (10.0.26200) / claude.ai OAuth /
claude-opus-4-7[1m]withclaude-haiku-4-5sub-agents / org fast mode on.Matches @neoDD69's Windows-11 / OAuth sub-pattern. One severity bump: this morning on 2.1.141 the banner fired on every prompt, not intermittently — Reload Window cleared it for one or two prompts before it returned. Confirms the bug is not Bedrock-only.
Stalls predate the regression — narrows the suspect surface. Per-session counts from this machine, last three days, same account:
| Session | extension |
stream_idle_partial|Streaming stall detected|sdk_stream_ended_no_result| Banner || --- | --- | ---: | ---: | ---: | --- |
| 2026-05-12 19:18 | 2.1.140 | 34 | 9 | 0 | no |
| 2026-05-13 09:02 | 2.1.140 | 111 | 22 | 1 | no |
| 2026-05-13 15:12 | 2.1.140 | 26 | 7 | 0 | no |
| 2026-05-14 10:07–11:55 (4 sessions) | 2.1.141 | 38 | 10 | 5 | last session: every prompt |
| 2026-05-14 12:35 (spans downgrade) | 2.1.141 → 2.1.140 | 5 | 3 | 1 | yes pre-downgrade, none post |
Stalls and even
sdk_stream_ended_no_resultevents were already ambient on 2.1.140 (e.g. 2026-05-13 09:02 had a stream-end event and no banner). So 2.1.141 didn't introduce the upstream stalls — it introduced the rendering/recovery path that turns them into the throw site @aumanjoa and @klatu201 dissected. That puts the regression in the webview/fallback handler in 2.1.141, not in stream stability.Workaround verified on Windows. @Antiklesys's downgrade to 2.1.140 plus disabling Auto Update on the extension cog. Multiple clean prompts since the downgrade, with stalls still occurring in the log but no banner.
Adding a data point that may broaden the reproduction conditions:
I'm hitting this on claude-opus-4-7[1m] in the VS Code extension on macOS (Darwin 25.4.0), but not only in long sessions:
Developer: Reload Windowclears it, but it recurs shortly after.So the "hundreds of turns / message_count: 556" framing in the original report may not be the full picture — turn count / context fill doesn't seem to be the gating factor in my case.
Small correction to my previous comment — checked the actual numbers on two sessions that just hit this: 12% and 15% of context consumed when it happened. Still well below auto-compact.
Same here. Confirming this is not Bedrock-only — reproducing on direct claude.ai with no Bedrock in the stack.
claude-opus-4-7[1m]Seriously? same here +1
I upgraded to macosx Tahoe 26.5 and right after that, this issue started coming today. This is kinda deal-breaker for me.
vscode: 1.120.0 (Universal)
claude code extension: 2.1.141
Model: claude-opus-4-7 (1m)
Provider: claude.ai (Max)
Thanks to @FunkeDope! I downgraded the claude code extension to 2.1.140 and the issue seems to be resolved.
Reverting to the previous ext version in VSCode (Click Uninstall>Install Specific Version) resolves the issue for now at least, just fyi.
+1 — confirming this reproduces outside the Bedrock setup described
in the original report.
Environment
Symptoms (identical to the original report)
long Thought blocks (>60s) combined with multiple tool calls in the
same turn (Read + Fetch + Agent).
while actual usage is well below limits (Session 13%, Weekly 34%,
Weekly Sonnet 1%).
<img width="490" height="122" alt="Image" src="https://github.com/user-attachments/assets/05d2e27b-5c00-4a46-9af8-dd1329e1ec22" />
I have frequently been able to recover forward progress by dismissing the error, then prompting the Claude Code for VS Code extension (2.1.141) within VS Code (1.120.0 on Tahoe 26.3.1 (a)) with "ping to restart after VSCode glitch"
<img width="570" height="129" alt="Image" src="https://github.com/user-attachments/assets/6b3c02d7-6981-48c1-b991-9de723344c87" />
Working local fix for the
Unhandled case: [object Object]crash — paste this whole comment into Claude Code and let it apply the patch for you.This thread covers a lot of triggers (Bedrock 0-event streams, stalls, etc.), but the crash you actually see always comes from the same place: one helper in the bundled webview parser throws on any stream event it doesn't recognize, and that single throw takes down the whole webview render — while the CLI backend keeps working fine.
You can neutralize the crash regardless of what triggered it. Find this exact string in
webview/index.js:Replace it with:
That's the whole fix — the UI now skips the unknown event instead of dying.
Notes for anyone applying this:
~/.vscode/extensions/anthropic.claude-code-<version>/webview/index.js.SessionStarthook so it re-applies automatically).Important: this fixes the crash, not whatever stalls/ends your stream in the first place — that's a separate server/extension bug. But it turns a session-killing red banner into a skipped event, so you stop losing in-flight work. I've been running it for a couple of days with no recurrence. Ideally the maintainers ship the same log-and-continue change so nobody has to patch their install. Also posted on #59013.
Further data points after another day of seeing this:
So in my environment the gating factor seems to be something that changed recently, not session length or context size. Possibly a recent extension/CLI update — happy to provide version info if useful.
Version info as offered: Claude Code 2.1.142 on macOS Darwin 25.4.0, VS Code extension, model
claude-opus-4-7[1m].so 2.1.142 has the same bug still? Should we all stay on 2.2.140???
Been happening every 3 prompts here since yesterday for me
I have the same issue since yesterday morning!
Guys, the problem is the same on VS Code in Windows 11. I confirm that downgrading to version 2.1.140 makes the problem disappear.
Closing, I am not getting this symptom anymore, and no one has reported in a while either