Update session replacement logic to ensure active session wrapper reflects committed session#318884
Draft
DonJayamanne wants to merge 1 commit into
Draft
Update session replacement logic to ensure active session wrapper reflects committed session#318884DonJayamanne wants to merge 1 commit into
DonJayamanne wants to merge 1 commit into
Conversation
…lects committed session
DonJayamanne
commented
May 29, 2026
| // Rewrite the visible wrapper so consumers of the active session observe | ||
| // the committed session object. This matters even when the provider keeps | ||
| // the same session id for the untitled -> committed transition. | ||
| this._visibility.updateSession(from, to); |
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes session replacement handling in the Agents window so that when a provider replaces an “untitled” session with its committed form without changing the session id, the active session wrapper is rebuilt to point at the committed ISession object. This addresses issue #318883 where UI surfaces (e.g. “Branch Changes”) could stay empty until navigating away/back because they were still observing the stale session instance.
Changes:
- Route provider
onDidReplaceSessionhandling throughVisibleSessions.updateSession(from, to)to rebuild the wrapper even whenfrom.sessionId === to.sessionId. - Add a regression test asserting that same-id replacement updates both
activeSessionandvisibleSessionswrappers.
Show a summary per file
| File | Description |
|---|---|
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts |
Uses VisibleSessions.updateSession during session replacement so the active/visible wrappers reflect the committed session object even when ids don’t change. |
src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts |
Adds a regression test covering same-id replacement updating the active session wrapper and visible sessions wrapper. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
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.
Fixes #318883