sessions: Sync GitHub context from new session input - #333847
Merged
Merged
Conversation
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 started reviewing on behalf of
Megan Rogge (meganrogge)
September 1, 2026 19:51
View session
Contributor
There was a problem hiding this comment.
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
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
src/vs/sessions/contrib/chat/browser/newChatInput.ts — The attachment identity preserves owner/repo casing, although GitHub repository coordinates are… |
|
src/vs/sessions/contrib/chat/browser/newChatInput.ts — This content-change sync is undone during history navigation: _navigateHistory calls… |
|
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>
Ladislau Szomoru (lszomoru)
approved these changes
Sep 1, 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 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.

github-issue.mov
Summary
Validation
npm run compilenpm run typecheck-client./scripts/test.sh --run src/vs/sessions/contrib/chat/test/browser/newChatInput.test.ts(16 passing)Fixes #333845