sessions: scope git availability to each session surface#326420
Open
sandy081 wants to merge 1 commit into
Open
sessions: scope git availability to each session surface#326420sandy081 wants to merge 1 commit into
sandy081 wants to merge 1 commit into
Conversation
Publish usable Git availability on ISession and have the shared session context key plumbing bind it into root and per-session scoped context key services. This keeps repository picker menu visibility aligned with each toolbar's own session when multiple session inputs are visible. Remove the provider contribution that mirrored only the globally active session, and add regression coverage for independent scoped contexts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Scopes Git availability to individual Agents window session surfaces so repository controls reflect the correct session.
Changes:
- Adds reactive, provider-refined Git availability to
ISession. - Publishes Git availability through scoped context keys.
- Removes global-session mirroring and adds regression coverage.
Show a summary per file
| File | Description |
|---|---|
.github/skills/sessions/SKILL.md |
Documents scoped menu-state guidance. |
src/vs/sessions/SESSIONS.md |
Documents the new session property. |
src/vs/sessions/common/contextkeys.ts |
Clarifies Git context-key semantics. |
src/vs/sessions/services/sessions/common/session.ts |
Adds hasGitRepository. |
src/vs/sessions/services/sessions/common/sessionContextKeys.ts |
Publishes Git state per context scope. |
src/vs/sessions/services/sessions/test/common/sessionContextKeys.test.ts |
Tests independent scoped values. |
src/vs/sessions/contrib/providers/copilotChatSessions/COPILOT_CHAT_SESSIONS_PROVIDER.md |
Documents provider behavior. |
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts |
Exposes reactive HEAD-aware Git state. |
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.ts |
Removes global context-key mirroring. |
src/vs/sessions/contrib/providers/copilotChatSessions/browser/isolationPicker.ts |
Simplifies HEAD availability detection. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Medium
Comment on lines
+498
to
+499
| /** Whether the session has a usable Git repository. Providers may refine this beyond workspace metadata. */ | ||
| readonly hasGitRepository?: IObservable<boolean>; |
roblourens
approved these changes
Jul 18, 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.
Follow-up to #326396 addressing Copilot Code Review feedback that repository picker visibility was driven by the globally active session rather than each toolbar's scoped session.
Changes
ISession.hasGitRepositoryfor provider-refined usable Git availability.setSessionContextKeys, soSessionHasGitRepositoryContextis set independently in root and per-session scoped context-key services.whenclauses.ISessionsService.activeSessioninto the global key.Validation
valid-layers-check: passed before rebasing the identical patch onto latestmaintypecheck-client: the change compiled before rebasing; latestmaincurrently reports unrelated baseline errors in native proxy config and MCP server types