VSCode extension 2.1.141: tool_reference content blocks crash renderer ("Unhandled case: [object Object]"), conversation stuck on "Thinking..."
Summary
In the VSCode extension anthropic.claude-code 2.1.141 (current latest, published 2026-05-13), any session whose transcript contains tool_reference content blocks crashes the webview renderer. A red banner appears at the top:
Unhandled case: [object Object]
View output logs · Troubleshooting resources
The conversation UI then stops rendering and stays stuck on Thinking..., even though the assistant turn has fully completed.
Root cause
The session .jsonl contains user entries with a tool_result block whose content is an array of { "type": "tool_reference", ... } blocks (17 of them in my case). These are produced by the ToolSearch tool, which loads schemas for deferred MCP tools.
The webview's content-block renderer has no case for tool_reference in its switch statement, falls through to default, and renders/throws Unhandled case: [object Object]. Rendering of all subsequent messages stops.
Evidence it is a render-only bug
In the affected session jsonl:
- The final entry is a normal
assistantmessage withstop_reason: end_turnand a complete textcontentblock (timestamp confirms the turn finished). - The file stops growing after that.
- No hung child processes, session CPU at 0%.
So compute completed and the full answer is in the transcript; only the UI is frozen.
Repro
- Use a setup with MCP servers / deferred tools configured (so
ToolSearchgets invoked). - Have a turn where Claude calls
ToolSearchto load tool schemas. - Renderer hits the
tool_referenceblocks in that turn'stool_resultand shows the banner; the rest of the conversation never renders.
Expected
- Renderer handles
tool_referenceblocks (e.g. a collapsed "loaded N tools" chip, or silently ignore them). - An unknown content-block type should never blank the remainder of the conversation, just skip that block.
Environment
anthropic.claude-codeVSCode extension2.1.141(darwin-arm64), CLI native binary2.1.141- macOS Darwin 23.6.0
- Model:
claude-opus-4-7
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗