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

Update chat in editor titles after rename tool#331509
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

Fixes #331487

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

I mentioned in my review above

I think we should have logic in the agent host to update the session title when the default chat title gets named, then we wouldn't have additional special-casing logic UI side

I don't think we should need the _onAction block at all

Done

@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Reworked the PR after #331394 merged and the issue still reproduced. Commit 37008ea moves the list-visible fix into Agent Host, removes the editor list action overlay, aligns tool/UI//rename default-chat behavior, and adds persistence/restoration coverage. Local validation: ESLint, client type-check, and 83 targeted tests passed.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 19, 2026 23:31

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/vs/platform/agentHost/node/agentHostStateManager.ts Outdated
Comment thread src/vs/platform/agentHost/node/agentHostStateManager.ts
Comment thread src/vs/platform/agentHost/node/agentService.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Comment thread src/vs/platform/agentHost/node/agentSideEffects.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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

Comment thread src/vs/platform/agentHost/node/agentSideEffects.ts

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

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