mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-14 07:54:36 +01:00
7bb3c8b46a
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>