vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Agent host: an automatic rename_chat overwrites a title the user set

Open roidayan1 opened this issue 2 months ago • 0 comments

An automatic rename_chat replaces a title the user gave an agent-host chat, both in the UI and in the persisted metadata, so the user's title is gone after a reload too.

Steps to reproduce

  1. Start an agent-host session with an agent that fulfils the host's automatic title reminder (seen with Codex).
  2. Rename the session or chat yourself.
  3. Send another message. The agent calls rename_chat with automatic: true.
  4. The title changes to the agent's. After a reload, the agent's title is still shown, with customTitleSource: agent in the session metadata.

Expected

An automatic rename leaves a title the user chose alone. A rename the user explicitly asks the agent for (automatic omitted) should still apply.

Cause

  • applyRenameChatTool (src/vs/platform/agentHost/node/shared/sessionServerTools.ts) reads automatic only to decide whether to run the rename in the background. It does not pass the flag to ISessionServerToolAccessor.renameChat.
  • AgentService._renameChatFromTool (src/vs/platform/agentHost/node/agentService.ts) then persists the agent's title with source agent unconditionally.
  • SessionTitleContribution records a user rename with source user, but nothing on the tool path checks that source before writing over it.

A fix with tests follows in a PR.

VS Code: main at c94d3d7ed24 (agent host) OS: macOS

roidayan1 avatar Sep 26 '26 16:09 roidayan1