Repository navigation
chat: use tool call id instead of tool id for input models - #275870
Conversation
There was a problem hiding this comment.
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
createToolInputUrifunction signature to accept onlystring(toolCallId) - Updated call sites to pass
toolInvocation.toolCallIdinstead oftoolInvocation.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); |
There was a problem hiding this comment.
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.
| const schemaUri = createToolSchemaUri(toolInvocation.toolCallId); | |
| const schemaUri = createToolSchemaUri(toolInvocation.toolId); |
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