fix: permit internal infrastructure tools when agent mode is disabled#293357
Merged
fix: permit internal infrastructure tools when agent mode is disabled#293357
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the inline chat v2 feature failed with "Missing inline chat exit tool" error when agent mode was disabled (chat.agent.enabled: false). The issue occurred because the isPermitted method in LanguageModelToolsService filtered tools down to only read/search/web tool sets when agent mode was disabled, inadvertently blocking the inline_chat_exit tool—an internal infrastructure tool required for inline chat to function.
Changes:
- Added a check to always permit internal tools with
canBeReferencedInPrompt: falseregardless of agent mode, treating them as system infrastructure rather than user-facing agent tools
…Service.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Member
Author
|
@copilot Analyze test failure and fix them. Also implement suggestion from #293357 (comment) |
Contributor
- Change condition from `!canBeReferencedInPrompt` to `canBeReferencedInPrompt === false` to only bypass agent mode checks for tools that explicitly cannot be referenced (like inline_chat_exit) - Add test case for issue #292935 to verify internal tools with canBeReferencedInPrompt=false are permitted when agent mode is disabled - Update comment to clarify "explicitly cannot be referenced" Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
fix: restrict internal tool bypass to explicitly non-referenceable infrastructure tools
joshspicer
approved these changes
Feb 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When agent mode is disabled (
chat.agent.enabled: false), theisPermittedcheck inLanguageModelToolsServicefilters visible tools down to only read/search/web tool sets.This inadvertently blocks the
inline_chat_exittool — an internal infrastructure toolrequired for inline chat v2 to function — causing the "Missing inline chat exit tool" error.
The fix: internal tools with
canBeReferencedInPrompt: falseare always permitted regardlessof agent mode, since they are system plumbing, not user-facing agent tools.
Fixes #292935