This repository was archived by the owner on May 20, 2026. It is now read-only.
Fix false-positive linkification of terminal commands in chat responses - #5042
Draft
vijayupadya with Copilot wants to merge 2 commits into
Draft
Fix false-positive linkification of terminal commands in chat responses#5042vijayupadya with Copilot wants to merge 2 commits into
vijayupadya with Copilot wants to merge 2 commits into
Conversation
Two changes to prevent false-positive linkification: 1. FilePathLinkifier: Require inline code paths to contain at least one dot or path separator (/ or \) to be considered a file path. This prevents command names like `code-insiders` or `test-byok-ext` from being matched. 2. ModelFilePathLinkifier: Reject "descriptive" link text that contains command-like patterns (=, \, /, --flag) when deciding whether to linkify markdown links with anchors. This prevents commands like `code-insiders --extensionDevelopmentPath=d:\src\test-byok-ext` from being incorrectly linked to workspace files. Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/85ca9a0f-13b7-4d88-a9f7-bdbeaf84cc1c Co-authored-by: vijayupadya <41652029+vijayupadya@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix terminal command linkification issue in documentation
Fix false-positive linkification of terminal commands in chat responses
Apr 8, 2026
scutuatua-crypto
approved these changes
Apr 8, 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.
Terminal commands like
`code-insiders --extensionDevelopmentPath=d:\src\test-byok-ext`were being incorrectly linkified, resolving to unrelated workspace files (e.g.src/common/spawnAsync.ts).Two independent issues in the linkification pipeline:
FilePathLinkifierinline code regex too permissive — matched any text in backticks (`code-insiders`,`test-byok-ext`), unlike the plain text regex which already required a dot. Added a lookahead requiring at least one.,/, or\in the content:ModelFilePathLinkifier.canLinkifyunconditionally allowed "descriptive" text with anchors — when the LLM generated[command text](src/file.ts#L10), the non-filename text was treated as a valid description. Now rejects text containing=,\,/, or--flagpatterns, which are characteristic of commands/paths rather than natural language descriptions.