Files
vscode/src
Rob Lourens 7bb3c8b46a chat: fix stranded "input needed" agent-host session on client-tool reconnect
When reconnecting to an active agent-host turn that is blocked on a client
tool, `provideChatSessionContent` invoked `_reconnectToActiveTurn`
synchronously before the chat model was registered in `IChatService`.
Reconnect re-invokes the blocked client tool, and
`LanguageModelToolsService.invokeTool` throws "Tool called for unknown chat
session" when the model is missing, leaving the turn blocked forever with the
session stuck in `InputNeeded` and no confirmation/question rendered.

- Defer `_reconnectToActiveTurn` until the chat model exists, mirroring the
  adjacent snapshot-controller `getSession` / `onDidCreateModel` guard.
- As defense in depth, dispatch a failed `ChatToolCallComplete` when a client
  tool fails pre-execution (non-cancellation), so a rejected tool call can no
  longer strand the turn.

Adds two repro tests in agentHostClientTools.test.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-26 10:35:10 -07:00
..