feat: Auto-link GitHub PR/issue references in chat messages#238
Merged
StephaneDelcroix merged 2 commits intomainfrom Feb 28, 2026
Merged
Conversation
Add built-in linkification for GitHub references (#123 and owner/repo#123) in chat messages. This converts plain-text issue/PR numbers into clickable links that open in the browser. - Add GitHubReferenceLinker utility that post-processes HTML after Markdig rendering to convert references to <a> links - Handle fully-qualified refs (owner/repo#123) without any repo context - Handle bare refs (#123) when session has a known repo URL - Safely skip content inside <a>, <code>, <pre>, <script>, <style> tags - Skip HTML entities ({) and URL fragments (/path#123) - Thread RepoUrl parameter through ChatMessageList → ChatMessageItem - Add GetRepoUrlForSession() to CopilotService for repo URL resolution - Add 30 unit tests covering all patterns and edge cases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject owner/repo paths containing characters outside [A-Za-z0-9._-/] to prevent HTML attribute injection via crafted SSH or HTTPS remote URLs. Add two regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
✅ Multi-Model Review: Ready to MergeInitial 5-model review found an XSS vulnerability (4/5 models flagged): 🟡 Fix applied in commit
Post-fix re-review (5 models): All confirmed XSS is fixed. No new consensus issues. |
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.
Summary
Adds built-in linkification for GitHub PR/issue references in chat messages. Plain-text references like
#123andowner/repo#123are automatically converted to clickable links that open in the browser.What Changed
<a>linksowner/repo#123) without any repo context#123) when the session has a known repo URL<a>,<code>,<pre>,<script>,<style>tags{) and URL fragments (/path#123)RenderMarkdown, acceptsRepoUrlparameterRepoUrltoRenderMarkdowncallsRepoUrlfrom session contextGetRepoUrlForSession()method resolves repo URL via WorktreeId or group RepoIdTests