Skip to content

chat: use tool call id instead of tool id for input models - #275870

Merged
Connor Peet (connor4312) merged 1 commit into
mainfrom
connor4312/275675
Nov 6, 2025
Merged

Connor Peet (connor4312) merged 1 commit into
mainfrom
connor4312/275675

Conversation

@connor4312

Copy link
Copy Markdown
Member

Closes #275675

cc roblourens -- I didn't see any other dependents of this URI/structure and it seems to work, lmk if you have concerns

Copilot AI review requested due to automatic review settings November 6, 2025 17:23
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) November 6, 2025 17:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the createToolInputUri function by removing its ability to accept IToolData | string and restricting it to only accept a string parameter. The function now expects a toolCallId to create unique URIs for each tool invocation's input data.

Key Changes

  • Simplified createToolInputUri function signature to accept only string (toolCallId)
  • Updated call sites to pass toolInvocation.toolCallId instead of toolInvocation.toolId

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/common/languageModelToolsService.ts Simplified createToolInputUri to only accept string parameter (toolCallId)
src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.ts Updated calls to use toolInvocation.toolCallId for both createToolInputUri and createToolSchemaUri


const markerOwner = generateUuid();
const schemaUri = createToolSchemaUri(toolInvocation.toolId);
const schemaUri = createToolSchemaUri(toolInvocation.toolCallId);

Copilot AI Nov 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The createToolSchemaUri function should receive toolInvocation.toolId instead of toolInvocation.toolCallId. The schema URI identifies the tool's schema definition (which is shared across all invocations of that tool), not the specific invocation. This breaks the schema association registered at languageModelToolsService.ts:158 which uses toolData.id to associate schemas with the pattern /lm/tool/${toolData.id}/tool_input.json.

Suggested change
const schemaUri = createToolSchemaUri(toolInvocation.toolCallId);
const schemaUri = createToolSchemaUri(toolInvocation.toolId);

Copilot uses AI. Check for mistakes.
@connor4312
Connor Peet (connor4312) merged commit ba76e6d into main Nov 6, 2025
@connor4312
Connor Peet (connor4312) deleted the connor4312/275675 branch November 6, 2025 17:41
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Dec 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModelService: Cannot add model because it already exists! error in chat window when agent attempts parallel tool executions

3 participants