You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sessions: show the Changes of a chat in several repositories per repository - #350808
What: When a chat works in several folders or repositories, the Changes view and editor group its changes by repository: a row for each repository with its name and branch, then its files. A Repository picker in the Changes header shows all repositories or one, whose own Branch changes, actions, pull request and Agent Merge the Changes then offer.
Changes:
ChangesViewService groups a chat's changes by repository (groupByRepository, folder failures) and keeps a repository selection per chat; ChangesViewPane builds the repository rows.
ChangesRepositoryPicker in the Changes view and editor headers (Agents window; desktop and web), gated on ChatContextKeys.enabled and ChangesHasRepositoriesContext.
The agent host provider gives a repository its own Branch changeset (getRepositoryChangeset) and Agent Merge folder, only for hosts that serve folder scopes (servesFolderScopes: the local agent host of this build) and record the session's folders.
ISessionAgentMergeService owns the per-session, per-chat and per-repository Agent Merge observables that were cached in module state.
Session action context key binders are classes with injected services; the Changes editor actions resolve their services in run.
The selected repository's pull request drives the Checks rows, the CI context keys and Fix Checks (IGitHubService.getSessionPullRequest(session, repositoryObs)). IGitHubService.keepSessionPullRequestCurrent refreshes and polls it, also a pull request known only from repository metadata, for the main window's and each scoped Changes' selection.
Agent host repository records carry their GitHub info, and the Repository picker updates its failure rows while open.
Agent Merge is offered for a picked repository only where its host serves that repository's scope (IAgentHostSessionsProvider.supportsRepositoryAgentMerge); Agent Merge and Fix Checks act on the chat of the Changes header they run from.
The Changes header of several repositories shows no base branch; that of a picked repository describes its own changeset.
Known limit: the host records a base branch only for a session's first folder, so a picked additional folder's Branch Changes show no target branch, and Commit is not offered for it.
Known limit: remote, Dev Container and cloud hosts keep the chats' changes for sessions of several folders, also when new enough to serve folder scopes, as no host advertises that support yet. Remote hosts keep one folder today (PR8). A follow-up can replace servesFolderScopes with a host-advertised capability.
Validation:
pnpm run typecheck-client: passed
./scripts/test.sh --run over every test of sessions/contrib/{changes,chatWindow,providers/agentHost,providers/remoteAgentHost,sessions,chat,github,layout,codeReview}, sessions/services, workbench/contrib/{sessionChanges,sessions}, workbench/services/sessions and platform/agentHost/test/node (433 files): 11,856 passing, 0 failing
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
CI state and Fix Checks still target the session’s first repository rather than the selected one, causing repair prompts to address the wrong pull request.
Adds repository-based grouping and selection to chat Changes views and editors, building on multi-folder sessions and per-repository Agent Merge support.
Changes:
Groups changed files by repository, showing branch names and folder failures, with a repository picker in Changes headers.
Routes repository-specific operations through folder-scoped changesets and moves Agent Merge observables into an injected service.
Extends provider contracts, accessibility guidance, fixtures, and tests for multi-repository workflows.
The Changes view and editor group a chat's changeset by repository: one
root per session folder or repository found in one, with its branch, and
other changes last. A repository picker, in the Changes editor's header
on desktop and web and in an editor window, filters the list to one
repository. The picked repository's actions, base branch and state come
from its own folder-only Branch changeset (`ISession.getRepositoryChangeset`),
observed only while it is picked or its changes are shown. Agent Merge
follows the picked repository. A session of several folders, also with
one in no repository, gives each repository its own scope. Single-folder
chats are unchanged.
The changes view service owns the repositories of the shown session, their
grouping (`groupByRepository`) and a repository's failure
(`findRepositoryFailure`).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… rows in the Changes view
- The Agent Merge state and configuration observables of a session's folders
were cached in module-level maps. ISessionAgentMergeService now owns those
caches as instance state; its consumers inject it instead of passing the
providers and configuration services to module functions.
- buildRepositoryChildren becomes a private method of ChangesViewPane, its
only consumer.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… and scope the Changes actions without an accessor
- Session action context key binders are classes the context keys create with
their services injected; Agent Merge's binder injects ISessionAgentMergeService.
- The Changes editor actions resolve their services in run and pass them to
InvokingChangesScopeAction.getInvokingChangesScope; mainWindowChangesOwner
takes the session host service.
- A repository of a session of several folders has its own Branch changeset
only when the host lists the session's repositories; with a host that does
not, the session's changes are its chats' as before.
- The Repository picker in the Changes file header requires chat to be enabled.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…folders on their own
A host records the folders of a multi-folder session on their own (the Git state
of a folder's scope, the repositories found in its folders, or the folders in no
repository) when it serves their scopes. The built-in host lists repositories
only when it finds nested ones, so the per-repository Branch changeset and Agent
Merge folder now follow those records, deriving each folder's scope as before;
a host that records none keeps the chats' changes only.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hosts from before independent folder scopes already record the folders of a
session of several on their own, so their records do not tell that they serve
each folder's scope. The local agent host is of this build and does; a provider
now says so with `servesFolderScopes`, and only its sessions get a repository's
own Branch changeset and Agent Merge folder. Other hosts' sessions keep their
chats' changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…epository picker current
- The CI context keys of the Changes and Fix Checks follow the pull request of
the repository the Changes show, else of the session folder.
- A chat's workspace reports each repository's own GitHub info: its folder's, or
its root's for one found in a folder.
- An open Repository picker updates when a repository's changes fail to load.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical defects can route actions to the wrong chat or pull request, break modal diff navigation, and allow Agent Merge activation for unsupported repository scopes.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Commit can affect a repository outside the selected scope, and Fix Checks can submit repairs for a different chat and repository than the header shows.
For an untitled two-repository session, selecting repository B still exposes an enabled Commit backed by the chat's Uncommitted Changes when only repository A has edits. The draft path bypasses the repository-filtered operations and reads A's uncommitted count, so Commit can affect a repository that is not shown. Pass repositoryObs through getInvokingChangesScope and this helper, and return no title operations or titleChangeset for a repository-selected draft.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because Commit can modify a different repository than the one selected, alongside pull-request routing and repository-selection UI inconsistencies.
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
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.
You can’t perform that action at this time.
✕
Wait! Don't Go Yet 🚀
Get our FREE eBook "10 Programming Tips That Changed Everything" when you subscribe!
What: When a chat works in several folders or repositories, the Changes view and editor group its changes by repository: a row for each repository with its name and branch, then its files. A Repository picker in the Changes header shows all repositories or one, whose own Branch changes, actions, pull request and Agent Merge the Changes then offer.
Changes:
ChangesViewServicegroups a chat's changes by repository (groupByRepository, folder failures) and keeps a repository selection per chat;ChangesViewPanebuilds the repository rows.ChangesRepositoryPickerin the Changes view and editor headers (Agents window; desktop and web), gated onChatContextKeys.enabledandChangesHasRepositoriesContext.getRepositoryChangeset) and Agent Merge folder, only for hosts that serve folder scopes (servesFolderScopes: the local agent host of this build) and record the session's folders.ISessionAgentMergeServiceowns the per-session, per-chat and per-repository Agent Merge observables that were cached in module state.run.IGitHubService.getSessionPullRequest(session, repositoryObs)).IGitHubService.keepSessionPullRequestCurrentrefreshes and polls it, also a pull request known only from repository metadata, for the main window's and each scoped Changes' selection.IAgentHostSessionsProvider.supportsRepositoryAgentMerge); Agent Merge and Fix Checks act on the chat of the Changes header they run from.Notes for reviewers:
mainafter Agents window: sessions of several folders in the agent host provider #350785 (PR8) and Agent host: Agent Merge per repository #350649 (PR11a) merged.servesFolderScopeswith a host-advertised capability.Validation:
pnpm run typecheck-client: passed./scripts/test.sh --runover every test ofsessions/contrib/{changes,chatWindow,providers/agentHost,providers/remoteAgentHost,sessions,chat,github,layout,codeReview},sessions/services,workbench/contrib/{sessionChanges,sessions},workbench/services/sessionsandplatform/agentHost/test/node(433 files): 11,856 passing, 0 failingnpx component-explorer render(all fixtures): rendered without errors; Playwright fixture tests: 99 passednode build/oxlint.tson the changed files,pnpm run valid-layers-check,node build/next/checkMobileBoundary.ts: passedWritten by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)