VSCode extension 2.1.141: tool_reference content blocks crash renderer ("Unhandled case: [object Object]"), conversation stuck on "Thinking..."

Resolved 💬 3 comments Opened May 14, 2026 by alex-odoo Closed May 15, 2026

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 assistant message with stop_reason: end_turn and a complete text content block (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

  1. Use a setup with MCP servers / deferred tools configured (so ToolSearch gets invoked).
  2. Have a turn where Claude calls ToolSearch to load tool schemas.
  3. Renderer hits the tool_reference blocks in that turn's tool_result and shows the banner; the rest of the conversation never renders.

Expected

  • Renderer handles tool_reference blocks (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-code VSCode extension 2.1.141 (darwin-arm64), CLI native binary 2.1.141
  • macOS Darwin 23.6.0
  • Model: claude-opus-4-7

View original on GitHub ↗

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