Skip to content

chat: restore GitHub issue and PR context attachments - #334544

Merged
Justin Chen (justschen) merged 5 commits into
mainfrom
agents/revert-issue-pr-context-attachment
Sep 4, 2026
Merged

chat: restore GitHub issue and PR context attachments#334544
Justin Chen (justschen) merged 5 commits into
mainfrom
agents/revert-issue-pr-context-attachment

Conversation

@meganrogge

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

Copy link
Copy Markdown
Collaborator

Fixes #334548

Part of #334542

Summary

  • revert the compact inline reference treatment for pasted GitHub issue and pull request URLs
  • restore pasted issue and pull request URLs as context attachments
  • restore automatic GitHub context attachment synchronization in the Agents composer
  • remove the temporary chat.pasteGitHubLinksAsReferences setting and compact-reference serialization/rendering support

Validation

  • npm run transpile-client
  • npm run hygiene
  • targeted ESLint on all changed TypeScript files
  • ./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/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts --run src/vs/workbench/contrib/chat/test/common/requestParser/chatRequestParser.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatInputPaste.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatInput.test.ts (120 passing, 1 pending)

npm run typecheck-client was also attempted, but this checkout is missing Electron and original-fs type dependencies; the resulting errors are repository-wide missing-module errors outside the changed files.

  • live Code OSS verification that pasted issue and PR URLs remain in the prompt and create context attachments

Screenshot

Pasted GitHub issue and pull request URLs retained in the prompt with issue and pull request context pills

Revert compact inline references for pasted GitHub issue and pull request URLs until attachment rendering is unified. Restore automatic context attachment synchronization in the Agents composer.\n\nRefs #334542\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep pasted issue and pull request URLs in the prompt while adding context attachments in regular Chat. Share URL parsing with the Agents composer and preserve undo behavior.\n\nRefs #334548\n\nCo-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

Three moderate URL-matching and link-interaction regressions remain unresolved.

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

Review tier: Balanced
Findings: 3 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts — The trailing word boundary accepts a valid number prefix from an invalid path, so text like…
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts — Keyboard events from a focused request link bubble to this listener. Without excluding anchor…
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts — This only recognizes clicks whose direct target is the anchor. Rich links still mount nested spans…
What changed in this PR

Restores GitHub issue and pull-request URLs as context attachments while removing temporary compact-reference behavior.

Changes:

  • Removes compact-reference parsing, rendering, decoration, and configuration.
  • Restores automatic GitHub attachment synchronization.
  • Updates paste, attachment lifecycle, and regression tests.

Required fixes:

  • Reject invalid issue paths such as /issues/333845-not-an-issue.
  • Preserve keyboard activation of request links by excluding anchor targets.
  • Detect nested rich-link click targets via their closest anchor.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​common/​requestParser/​chatRequestParser.test.ts Removes compact-reference range tests.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​editor/​chatPasteProviders.test.ts Removes compact GitHub paste cases.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​chatListRenderer.test.ts Removes compact-link rendering tests.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​attachments/​chatVariables.test.ts Removes compact-reference behavior tests.
src/​vs/​workbench/​contrib/​chat/​common/​requestParser/​chatRequestParser.ts Stops forwarding prompt-text overrides.
src/​vs/​workbench/​contrib/​chat/​common/​requestParser/​chatParserTypes.ts Simplifies prompt text and dynamic variables.
src/​vs/​workbench/​contrib/​chat/​common/​model/​chatModel.ts Restores simple range adjustment.
src/​vs/​workbench/​contrib/​chat/​common/​constants.ts Removes the temporary setting identifier.
src/​vs/​workbench/​contrib/​chat/​common/​chatService/​chatServiceImpl.ts Adapts callers to restored range updates.
src/​vs/​workbench/​contrib/​chat/​common/​attachments/​chatVariables.ts Removes compact-reference metadata.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​editor/​chatPasteProviders.ts Removes GitHub-specific paste transformation.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​editor/​chatInputReferenceDecorations.ts Removes compact-reference decorations.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts Reverts compact-link interaction handling.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatContentParts/​chatMarkdownDecorationsRenderer.ts Removes compact-link rendering support.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.ts Simplifies the paste-target interface.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Removes the temporary configuration.
src/​vs/​workbench/​contrib/​chat/​browser/​attachments/​chatWidgetPasteTarget.ts Simplifies inline-reference handling.
src/​vs/​workbench/​contrib/​chat/​browser/​attachments/​chatDynamicVariables.ts Removes compact-reference model support.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​newChatInputPaste.test.ts Tests attachment paste undo/redo behavior.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​newChatInput.test.ts Tests GitHub attachment synchronization.
src/​vs/​sessions/​contrib/​chat/​common/​newChatContextIds.ts Adds input-derived GitHub context metadata.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatInputPasteTarget.ts Restores attachment-backed paste handling.
src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts Synchronizes GitHub URLs with attachments.
src/​vs/​sessions/​contrib/​chat/​browser/​media/​chatInput.css Removes compact-reference styling.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/sessions/contrib/chat/browser/newChatInput.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
Comment thread src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Outdated
Represent pasted GitHub links as generic context so issue and pull request pills render their respective Codicons without generic pasted-content chrome.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge

Copy link
Copy Markdown
Collaborator Author

cc Justin Chen (@justschen)

Reject invalid GitHub issue and pull request URL continuations, and keep nested request links keyboard- and pointer-operable when inline request editing is enabled.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wrap the GitHub attachment parser callback so Array.prototype.flatMap does not pass its numeric index into the optional metadata parameter.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@justschen
Justin Chen (justschen) merged commit 99fbee3 into main Sep 4, 2026
40 checks passed
@justschen
Justin Chen (justschen) deleted the agents/revert-issue-pr-context-attachment branch September 4, 2026 18:54
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 4, 2026
@justschen Justin Chen (justschen) added release-cherry-pick Automated cherry-pick between release and main branches ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch and removed release-cherry-pick Automated cherry-pick between release and main branches labels Sep 4, 2026
@vs-code-engineering vs-code-engineering Bot added release-cherry-pick Automated cherry-pick between release and main branches and removed ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch labels Sep 4, 2026
@justschen Justin Chen (justschen) added ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch and removed release-cherry-pick Automated cherry-pick between release and main branches labels Sep 4, 2026
Megan Rogge (meganrogge) added a commit that referenced this pull request Sep 5, 2026
* chat: restore GitHub issue and PR context attachments

Revert compact inline references for pasted GitHub issue and pull request URLs until attachment rendering is unified. Restore automatic context attachment synchronization in the Agents composer.\n\nRefs #334542\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: attach pasted GitHub links as context

Keep pasted issue and pull request URLs in the prompt while adding context attachments in regular Chat. Share URL parsing with the Agents composer and preserve undo behavior.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: use semantic icons for GitHub context

Represent pasted GitHub links as generic context so issue and pull request pills render their respective Codicons without generic pasted-content chrome.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: preserve request link interactions

Reject invalid GitHub issue and pull request URL continuations, and keep nested request links keyboard- and pointer-operable when inline request editing is enabled.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: avoid forwarding flatMap index as metadata

Wrap the GitHub attachment parser callback so Array.prototype.flatMap does not pass its numeric index into the optional metadata parameter.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Megan Rogge (meganrogge) added a commit that referenced this pull request Sep 5, 2026
…334620)

chat: restore GitHub issue and PR context attachments (#334544)

* chat: restore GitHub issue and PR context attachments

Revert compact inline references for pasted GitHub issue and pull request URLs until attachment rendering is unified. Restore automatic context attachment synchronization in the Agents composer.\n\nRefs #334542\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: attach pasted GitHub links as context

Keep pasted issue and pull request URLs in the prompt while adding context attachments in regular Chat. Share URL parsing with the Agents composer and preserve undo behavior.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: use semantic icons for GitHub context

Represent pasted GitHub links as generic context so issue and pull request pills render their respective Codicons without generic pasted-content chrome.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chat: preserve request link interactions

Reject invalid GitHub issue and pull request URL continuations, and keep nested request links keyboard- and pointer-operable when inline request editing is enabled.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: avoid forwarding flatMap index as metadata

Wrap the GitHub attachment parser callback so Array.prototype.flatMap does not pass its numeric index into the optional metadata parameter.\n\nRefs #334548\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Megan Rogge <merogge@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat: Restore issue and PR context attachments temporarily

6 participants