Repository navigation
fix: session rename no longer requires reload (#318442) - #318667
Open
Yashwanth Reddy Katipally (katipally) wants to merge 10 commits into
Open
Yashwanth Reddy Katipally (katipally) wants to merge 10 commits into
Yashwanth Reddy Katipally (katipally) wants to merge 10 commits into
Conversation
Two bugs caused renaming a session to not persist without a reload: Bug A — history sessions: The controller's refresh() only tracked newly added items, not updated ones. When a history session was renamed, the new items matched the same resource URIs, so addedOrUpdated stayed empty and _onDidChangeChatSessionItems never fired. Fixed by comparing with isEqual() to detect changed labels. Added onDidChangeChatSessionTitle event to IChatService so the controller can react to title changes for history sessions (which have no live model). The event fires from setChatSessionTitle() only for history sessions; live sessions are already handled by the model.onDidChange → autorun path. Bug B — persistence: renameChat() in localChatSessionsProvider called setSessionTitle() (sync, in-memory only) instead of setChatSessionTitle() (async, writes to _chatSessionStore). On reload the old title would return because nothing was actually written to disk. Fixed by awaiting setChatSessionTitle() instead. Also corrected the IChatService interface: setChatSessionTitle() was declared void but implemented as async Promise<void>.
Author
|
@microsoft-github-policy-service agree |
The test mock was missing setChatSessionTitle (async) which was added to IChatService and called by renameChat(). This caused a 'not a function' TypeError across all CI platforms.
Yashwanth Reddy Katipally (katipally)
force-pushed
the
main
branch
from
May 29, 2026 08:39
168d041 to
7115f70
Compare
This branch has not been deployed
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 #318442
Problem
Renaming a session in the Agents window required a window reload for the new name to appear. Two separate bugs caused this:
Bug A — UI not updating (history sessions)
LocalAgentsSessionsController.refresh()only detected new session items (checking!this._items.has(resource)). When a history session was renamed, the resource URI was already in_items, soaddedOrUpdatedstayed empty and_onDidChangeChatSessionItemsnever fired — the sidebar stayed stale.Bug B — Title not persisted
renameChat()inlocalChatSessionsProvider.tscalledchatService.setSessionTitle()(synchronous, in-memory only) instead ofchatService.setChatSessionTitle()(async, writes to_chatSessionStore). On reload the old title came back because nothing was written to disk.Solution
refresh()to useexisting.isEqual(item)so updated items (changed label, status, etc.) are included inaddedOrUpdated.onDidChangeChatSessionTitleevent toIChatService. Fire it fromsetChatSessionTitle()for history sessions only (live sessions already propagate viamodel.onDidChange → autorun). Subscribe the controller to this event so it callsrefresh()immediately.renameChat()toawait chatService.setChatSessionTitle()so the title is persisted to the session store.IChatService.setChatSessionTitlereturn type fromvoidtoPromise<void>to match the implementation.Files changed
chatService.tsonDidChangeChatSessionTitleevent; fixed return typechatServiceImpl.tslocalAgentSessionsController.tsrefresh()update detection; added event listenerlocalChatSessionsProvider.tssetChatSessionTitleinstead ofsetSessionTitlemockChatService.tscopilotChatSessionsProvider.test.ts