sessions: add Session Files section to the Changes view#323725
Merged
Conversation
Add a collapsible/resizable 'Session Files' section to the agents Changes view, modeled on the CI Checks section, listing files created/edited/deleted outside the session workspace folders during the session (these are not committed). Data is parsed from the agent-host chat-state turns (response parts -> tool calls -> FileEdit results/pending edits) and exposed via a new optional 'externalChanges' observable on ISession. Parsing is incremental: completed turns are memoized by id and only the active turn is re-parsed per streamed delta, with equality functions to suppress redundant downstream work. Computation is gated on the active, non-archived session. Click opens created/deleted files normally and edited files as a diff. Adds component-explorer fixtures and unit tests covering delta-only recomputation and reduce semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Screenshot ChangesBase: Added (6) |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds an “Session Files” section to the Agents window Changes view, surfacing files that were created/modified/deleted outside the session workspace folders by parsing agent-host chat/tool-call file edit results and presenting them in a dedicated, collapsible SplitView pane.
Changes:
- Extend the sessions model with
SessionFileOperation,ISessionFile, and an optionalISession.externalChangesobservable for “external” file changes. - Parse/memoize file edits from agent-host chat-state turns and reduce them into per-file operations filtered to outside workspace roots.
- Add a new
SessionFilesWidget+ view model + CSS, integrate it as a new SplitView section inchangesView.ts, and add fixtures/tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/services/sessions/common/session.ts | Adds SessionFileOperation, ISessionFile, and optional ISession.externalChanges API surface. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionFiles.test.ts | New unit tests covering parsing, incremental recomputation, and reduce semantics. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Wires externalChanges onto AgentHostSessionAdapter via createSessionFilesObs. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionFiles.ts | New implementation for parsing tool-call file edits and reducing them into ISessionFile[]. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionChangesets.ts | Exports createActiveSessionSubscriptionObs for reuse by session-files parsing. |
| src/vs/sessions/contrib/changes/test/browser/sessionFilesWidget.fixture.ts | New component-explorer fixture coverage for the widget. |
| src/vs/sessions/contrib/changes/browser/sessionFilesWidget.ts | New UI widget rendering the Session Files list and handling open/diff behavior. |
| src/vs/sessions/contrib/changes/browser/sessionFilesViewModel.ts | New view model exposing activeSession.externalChanges with stable empty fallback. |
| src/vs/sessions/contrib/changes/browser/media/sessionFilesWidget.css | Styling for the new section to match existing Checks section behavior. |
| src/vs/sessions/contrib/changes/browser/changesView.ts | Integrates the new widget as an additional SplitView pane and factors shared wiring logic. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 3
- Review effort level: Low
The Session Files widget fixture failed to render because ResourceLabels depends on IWorkspaceContextService, IDecorationsService, ITextFileService and INotebookDocumentService, which the base fixture services don't provide. Register mock instances the same way the multiDiffEditor fixture does. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add a Changes-view accessibility help dialog (SessionsChangesAccessibilityHelp) with a new verbosity setting, documenting the file tree and the Session Files / Checks sections and how to operate them (collapse/expand, open file vs diff). - Handle touch in the Session Files header via Gesture.addTarget + TouchEventType.Tap so the collapse/expand toggle works on touch platforms. - Use getComparisonKey(uri) instead of uri.toString() for Map keys and sorting in reduceSessionFiles, for safe cross-platform URI identity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SessionFilesWidget creates a WorkbenchList, which depends on IListService. Register it in the fixture (as the aiCustomizationListWidget fixture does) so the widget can be instantiated under the component explorer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pwang347
approved these changes
Jun 30, 2026
benibenj
enabled auto-merge (squash)
June 30, 2026 14:58
Contributor
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.
What
Adds a new collapsible/resizable "Session Files" section to the agents Changes view, modeled on the existing CI Checks section (same collapse/resize/SplitView behavior). It sits between the file tree (top) and the Checks section (bottom).
The section lists files that were created, edited, or deleted outside the session workspace folders during the session (e.g. config files in the user's home directory). A header hover explains that these files are not part of the workspace and won't be committed. Files render in a tree with resource labels (file icons, dir path, strikethrough for deletions), just like the other file-based trees.
How
session.ts): newSessionFileOperationenum (Created/Modified/Deleted) andISessionFileinterface, plus a new optionalexternalChangesobservable onISession(empty/omitted for providers that can't supply it).agentHostSessionFiles.ts): subscribes to the agent-host chat-state turns, walksresponseParts → tool calls → FileEditresults (and pending-confirmation edits), classifies create/edit/delete/rename vianormalizeFileEdit, filters to files outside every workspace folder's working directory, and reduces per file (created-then-edited → Created; delete overrides; rename = delete+create). Wired ontoAgentHostSessionAdapter.SessionFilesWidget+SessionFilesViewModel+ CSS, integrated intochangesView.tsas a third SplitView pane (shared_wireSectionPanehelper now drives both Session Files and Checks). Click opens created/deleted files normally and edited files as a diff (before vs after).Performance
Parsing is incremental: completed turns are immutable, so each is parsed once and memoized by turn id; only the in-progress
activeTurnis re-parsed per streamed delta (O(active turn) instead of O(all turns)). Equality functions on the per-chat edits and finalexternalChangesobservable suppress redundant downstream work. Computation is gated on the active, non-archived session — archived sessions open no subscriptions and do no parsing.Tests
sessionFilesWidget.fixture.ts).agentHostSessionFiles.test.ts, 5 passing) covering delta-only recomputation, completed-turn retention during streaming, protocol parsing of completed/pending tool calls, and reduce semantics (create-then-edit, delete override, rename, workspace filtering).Notes for reviewers
ISessionproperty is namedexternalChanges.tsgotypecheck (0 errors), ESLint (0 errors/warnings),valid-layers-check, hygiene/precommit, and the unit suite.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com