Skip to content

Update chat in editor titles after rename tool - #331509

Merged
Dmitriy Vasyura (dmitrivMS) merged 15 commits into
mainfrom
dev/dmitriv/fix-editor-chat-rename
Aug 21, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 15 commits into
mainfrom
dev/dmitriv/fix-editor-chat-rename

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • synchronize a renamed default chat with its owning session in the Agent Host, so the existing session-summary pipeline updates every editor-window session list
  • apply the same host-owned behavior for the rename_chat tool, client/UI editor renames, and /rename, while keeping peer-chat titles independent
  • route editor rename callbacks through the addressed chat channel rather than the parent session
  • resolve editor-tab titles from the canonical addressed chat; an empty canonical default-chat title inherits the session title, while routing-default peers do not
  • snapshot and persist an inherited canonical default-chat title when the first peer appears, without overwriting an existing or newer title, so later session renames and restarts preserve independence
  • remove the editor-window session-list action overlay; merged PR agents window: fix sessions list progress #331394 publishes the resulting session-title change through root/sessionSummaryChanged
  • update the rename_chat model description to match the default-chat/session and independent-peer behavior

Testing

  • npm run eslint -- on the changed Agent Host and workbench files
  • npm run typecheck-client
  • 108 targeted tests covering Agent Host rename persistence/failure, editor and /rename routing, restored multi-chat catalogs, snapshot races, tool definitions, editor titles, and editor-window session-list behavior

Fixes #331487

Copilot AI balanced review requested due to automatic review settings August 18, 2026 17:14
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added bug Issue identified by VS Code Team member as probable bug chat labels Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Agent Host chat editor and session-list titles after live rename actions.

Changes:

  • Selects per-chat titles for multi-chat sessions.
  • Preserves session titles for sole default chats.
  • Adds live title synchronization and targeted tests.
Show a summary per file
File Description
agentHostSessionHandler.ts Resolves and synchronizes editor titles.
agentHostSessionListStore.ts Applies live title actions to session-list entries.
agentHostChatContribution.test.ts Tests session-list and editor title updates.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.ts:352

  • This title is only retained in the current _entries value. A default-chat rename in a multi-chat session updates the chat catalog but not the session title (agentService.ts:1175-1200), while a later listSessions() refresh rebuilds metadata from liveSummary.title (agentService.ts:1276-1284). Consequently, an action received before the entry is cached—or any later cache invalidation such as a workspace change—restores the old session title. Please retain the effective default-chat title independently and reapply it during refresh, or expose that effective title from listSessions().
		const cached = this._entries.get(key);
		if (!cached || cached.summary.title === title) {
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as draft August 18, 2026 18:21
auto-merge was automatically disabled August 18, 2026 18:21

Pull request was converted to draft

@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Will wait for the #331394 to merge first

@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

comments

Thank you!

@dmitrivMS Dmitriy Vasyura (dmitrivMS) changed the title chat: update editor titles after rename tool Update chat in editor titles after rename tool Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts:1467

  • Renaming an open chat still dispatches SessionTitleChanged to the owning session URI below. Once a peer has caused the default chat title to be snapshotted, this changes only the session title, so the addressed editor tab keeps its old catalog title; renaming a peer editor also renames the owning session instead of that peer. Dispatch through the mapped chat channel when one is available so the new host-side chat/default routing is exercised.
				chatTitle,
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 20, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 771cd9d into main Aug 21, 2026
28 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the dev/dmitriv/fix-editor-chat-rename branch August 21, 2026 19:06
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 21, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

agent-host Issues for the agent-host implementation (not the protocol) bug Issue identified by VS Code Team member as probable bug chat

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Rename chat tool in editor window does not seem to have effect

4 participants