Skip to content

sessions: Sync GitHub context from new session input - #333847

Merged
Megan Rogge (meganrogge) merged 2 commits into
mainfrom
agents/fix-vscode-issue-333845
Sep 1, 2026
Merged

sessions: Sync GitHub context from new session input#333847
Megan Rogge (meganrogge) merged 2 commits into
mainfrom
agents/fix-vscode-issue-333845

Conversation

@meganrogge

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

Copy link
Copy Markdown
Collaborator
github-issue.mov

Summary

  • create issue and pull request context attachments from GitHub URLs in the new-session composer
  • remove input-derived context when its URL is deleted
  • preserve explicitly selected context when it matches an input-derived attachment

Validation

  • npm run compile
  • npm run typecheck-client
  • ./scripts/test.sh --run src/vs/sessions/contrib/chat/test/browser/newChatInput.test.ts (16 passing)
  • verified in Code OSS that pasting/removing an issue URL adds/removes the context pill and that the issue icon renders

Fixes #333845

Create and remove issue and pull request context attachments as matching URLs are edited in the new-session composer. Preserve explicitly selected context when it matches an input-derived attachment.\n\nFixes #333845\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 1, 2026 19:50

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

History restoration, case-insensitive identity, and screen-reader announcements need correction.

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 attachment identity preserves owner/repo casing, although GitHub repository coordinates are…
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts — This content-change sync is undone during history navigation: _navigateHistory calls…
Medium severity src/​vs/​sessions/​contrib/​chat/​browser/​newChatInput.ts — Automatically adding or removing these pills changes the context that will be sent, but the…
What changed in this PR

Adds automatic GitHub issue and pull-request context synchronization to the new-session composer.

Changes:

  • Creates and removes context pills based on input URLs.
  • Preserves matching explicitly selected context.
  • Adds focused synchronization and rendering tests.
File Description
newChatInput.ts Implements URL parsing and attachment synchronization.
newChatInput.test.ts Tests synchronization, preservation, icons, and accessibility.

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

Comment on lines +229 to +230
const uri = `https://github.com/${owner}/${repo}/${kind}/${number}`;
const id = `github-context:${uri}`;
)));

this._register(this._editor.onDidChangeModelContent(() => {
this._syncInputGitHubContext();
}
if (attachments.length !== this._contextAttachments.attachments.length
|| attachments.some((attachment, index) => attachment !== this._contextAttachments.attachments[index])) {
this._contextAttachments.setAttachments(attachments);
Route GitHub input-context metadata through a common validating reader to satisfy metadata hygiene.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge
Megan Rogge (meganrogge) merged commit 33913cb into main Sep 1, 2026
40 checks passed
@meganrogge
Megan Rogge (meganrogge) deleted the agents/fix-vscode-issue-333845 branch September 1, 2026 20:30
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 1, 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.

When I paste a PR or issue link, the pill should update

3 participants