Conversation
…ed out Tools registered via registerToolDefinition by the default chat agent (copilot-chat) were incorrectly getting source type 'extension' instead of ToolDataSource.Internal. This caused them to be filtered out by the chat.extensionTools.enabled setting check in getAllToolsIncludingDisabled(). Package.json-contributed tools from the same extension correctly got ToolDataSource.Internal via the isBuiltinTool check in languageModelToolsContribution.ts. Apply the same logic in $registerToolWithDefinition on the main thread.
5281cf5 to
7c5b0f7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes tool source classification for tools registered via registerToolDefinition by the default chat agent so they are treated as built-in/internal tools (and therefore not filtered by the chat.extensionTools.enabled gate).
Changes:
- Inject
IProductServiceintoMainThreadLanguageModelTools. - Detect when the registering extension matches
productService.defaultChatAgent.chatExtensionIdand forceToolDataSource.Internalinstead of using the DTO-provided source.
connor4312
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tools registered via
registerToolDefinitionby the default chat agent (copilot-chat) were incorrectly getting source typeextensioninstead ofToolDataSource.Internal. This caused them to be filtered out by thechat.extensionTools.enabledsetting check ingetAllToolsIncludingDisabled().Package.json-contributed tools from the same extension correctly got
ToolDataSource.Internalvia theisBuiltinToolcheck inlanguageModelToolsContribution.ts. This applies the same logic in$registerToolWithDefinitionon the main thread.