[BUG] [BUG] VS Code extension: "Unhandled case: [object Object]" while reading combined output of two long-running background dev servers (git worktree workflow)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The red banner Unhandled case: [object Object] (with "View output logs · Troubleshooting resources" links) appears in the chat panel mid-turn while the agent is processing the combined output of two concurrently-running background processes started inside a git worktree. The chat panel becomes unresponsive — the "Thinking…" indicator is visible but never resolves. Developer: Reload Window is the only recovery; the underlying CLI session/transcript appears intact after reload.
This matches the symptom described in #58984 (webview renderer hits an unhandled discriminated-union case while the host process is fine), but the trigger pattern is distinct from the existing reports: it is not a long conversation history, not an image follow-up, not Bedrock, and not a malformed tool-input type. It reproduces consistently in a git-worktree + concurrent background dev servers workflow.
What Should Happen?
The renderer should either:
Render the unrecognised event variant as a generic tool/stream message and continue, or
Log the full object (not stringify to [object Object]) so the actual offending event variant can be identified
…rather than entering a permanent stall state.
Error Messages/Logs
Steps to Reproduce
- Open a Cloudflare Workers project in VS Code with the Claude Code extension.
- Ask Claude Code to set up a parallel git worktree for a branch (e.g. git worktree add ../<repo>-otp -b fix/<branch>)
- In the same turn, ask it to start the web dev server and the worker dev server as separate background processes inside the new worktree.
- Engineer (or wait for) one of the two background processes to fail at startup — port conflict, missing env var, or wrangler.toml issue all work.
- Ask Claude Code to "check what happened" — it will typically issue a single combined tail/head bash call across both output files.
- Observe the red Unhandled case: [object Object] banner appear shortly after that bash call returns. The chat panel stops rendering; "Thinking…" persists indefinitely.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.141
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗