VSCode extension: stray input leaks across sessions; one session permanently wedged on 400 tool_use_id error
Summary
Two related bugs observed in the VSCode native extension (multi-session sidebar UI, ~33 sessions open):
1. Cross-session message leak
The literal string source /Users/silent/AILab/Medical_Agent/.venv/bin/activate appeared as a submitted user message in two unrelated sessions ("Medical Agent 01" and a separate TradingAgent/ledger-explorer session) without being typed into either session. This looks like an input meant for one terminal/session pane got queued and replayed into a different session.
In the observed case it was harmless — Claude recognized the command didn't match the second session's project context and treated it as a no-op — but this is correct-by-luck, not guaranteed. A destructive or context-appropriate-looking command leaking this way could execute unintended actions in the wrong project.
2. Session permanently wedged after advisor tool call
Separately, the "Medical Agent 01" session became permanently unusable after a successful advisor tool call (used mid-task for a medication-dedup bugfix). Every subsequent prompt in that session — including trivial ones like pull up the pending task list from mem and md or a plain source .../venv/bin/activate — fails in ~1 second with:
API Error: 400 messages.29.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks: srvtoolu_016eSoU2YGVBmN2PM3Bb3Hhp.
Each `advisor_tool_result` block must have a corresponding `server_tool_use` block before it.
This indicates the session's persisted transcript has a tool_use/tool_result pairing for the advisor tool that got corrupted or split — likely during a compaction or interrupted request right after the successful advisor call. Every new turn resends the full (broken) history and is rejected before any tool executes. The only workaround found was abandoning the session and starting fresh; there's no way to recover or continue the wedged session.
Environment
- Claude Code VSCode native extension
- Multi-session sidebar with ~33 concurrent sessions
- Model: Sonnet 5
Impact
- Bug 1: potential for unintended cross-project command execution (safety-relevant).
- Bug 2: total loss of session continuity/context after a specific tool-use pattern; no recovery path other than discarding the session.
Screenshots available on request.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗