Skip to content

Chat: Render pasted GitHub issue links - #334068

Merged
Megan Rogge (meganrogge) merged 4 commits into
mainfrom
agents/clickable-github-links-in-issues
Sep 2, 2026
Merged

Chat: Render pasted GitHub issue links#334068
Megan Rogge (meganrogge) merged 4 commits into
mainfrom
agents/clickable-github-links-in-issues

Conversation

@meganrogge

@meganrogge Megan Rogge (meganrogge) commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator
Image

Fixes #334061

Summary

  • Render pasted GitHub issue and pull request URLs as compact, clickable owner/repo#number references in regular Chat and the Agents new-session composer.
  • Show the corresponding issue or pull-request codicon and keep it vertically centered with the label.
  • Preserve the complete original URL, including fragments, as agent-facing prompt text without adding attached context.
  • Remove automatic detection of typed GitHub URLs as context attachments from the Agents new-session composer; explicit context attachments remain supported.
  • Keep long pasted text inline in the Agents composer while retaining regular Chat long-paste behavior.
  • Add the default-on chat.pasteGitHubLinksAsReferences setting and preserve reference ranges through prompt substitution, history/draft restoration, and replacement undo/redo.

Testing

  • npm run transpile-client
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/attachments/chatVariables.test.ts --run src/vs/workbench/contrib/chat/test/browser/widget/input/editor/chatPasteProviders.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatInputPaste.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatInput.test.ts (37 passing)
  • npm run typecheck-client
  • npm run valid-layers-check
  • Verified in Code OSS that regular Chat and Agents show a compact detected link with the correct centered codicon, send the full URL, and create zero attachment pills. Also verified that long pasted text stays inline in Agents.

Fixes #334061

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 2, 2026 17:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Invalid zero-valued issue and pull-request paths are incorrectly recognized as GitHub links.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​editor/​chatPasteProviders.ts — This also recognizes /issues/0 and /pull/00, even though GitHub issue and pull-request numbers…
What changed in this PR

Converts pasted GitHub issue and pull-request URLs into concise Markdown links in chat inputs.

Changes:

  • Detects GitHub issue and pull-request URLs during paste.
  • Adds coverage for issue, pull-request, and non-GitHub URLs.
File Description
chatPasteProviders.ts Adds GitHub URL recognition and Markdown insertion.
chatPasteProviders.test.ts Tests the new paste behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.ts Outdated
Display pasted GitHub issue and pull request URLs as clickable inline references while preserving the full URL in the prompt and avoiding context attachments. Add a default-on setting and keep plain paste behavior for unsupported inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge
Megan Rogge (meganrogge) merged commit 6442769 into main Sep 2, 2026
40 checks passed
@meganrogge
Megan Rogge (meganrogge) deleted the agents/clickable-github-links-in-issues branch September 2, 2026 19:43
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat: Render pasted GitHub issue and pull request URLs as links

3 participants