[BUG] AskUserQuestion permission stream closes before response - "Unhandled case: [object Object]" in VS Code extension
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?
When Claude Code invokes the AskUserQuestion tool, the permission stream closes before a response is received. This causes a JSON parse error (Expected ']') due to malformed tool input JSON, which then surfaces as Unhandled case: [object Object] in the VS Code extension UI. The session becomes unresponsive and shows a stream stall before dying.
What Should Happen?
The AskUserQuestion tool permission prompt should render in the VS Code extension, wait for user input, and return a valid response to the stream without closing prematurely.
Error Messages/Logs
[ERROR] "SyntaxError: SyntaxError: JSON Parse error: Expected ']'
at <parse> (:0)
at parse (unknown)
at jOK (B:/~BUN/root/src/entrypoints/cli.js:175:10088)"
[DEBUG] "AskUserQuestion tool input error: AskUserQuestion failed due to the following issue:
The required parameter `questions` is missing"
[WARN] Streaming completed with 1 stall(s), total stall time: 54.7s
Tool output:
Tool permission request failed: Error: Tool permission stream closed before response received
Steps to Reproduce
- Open Claude Code in VS Code
- Start a session with a sufficiently complex or multi-step task
- Wait for Claude Code to invoke the AskUserQuestion tool (typically happens when it needs clarification mid-task)
- Observe that the permission prompt does not appear in the extension UI
- Stream stalls (~15-30s) then closes with "Tool permission stream closed before response received"
- Extension displays "Unhandled case: [object Object]" in the chat UI
Note: Issue appears intermittent and more likely to occur in longer sessions or after previous stalls.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.92 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Issue occurs intermittently, more frequently in longer sessions. Stream stall warnings appear in logs before the crash (stream_idle_partial with lastChunkAgeMs=15000+). Session had message_count=420 in one instance. OS: Windows (Bun runtime path B:/~BUN/ visible in stack trace).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗