vscode
vscode copied to clipboard
Agent host: an automatic rename_chat overwrites a title the user set
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
- Start an agent-host session with an agent that fulfils the host's automatic title reminder (seen with Codex).
- Rename the session or chat yourself.
- Send another message. The agent calls
rename_chatwithautomatic: true. - The title changes to the agent's. After a reload, the agent's title is still shown, with
customTitleSource: agentin 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) readsautomaticonly to decide whether to run the rename in the background. It does not pass the flag toISessionServerToolAccessor.renameChat.AgentService._renameChatFromTool(src/vs/platform/agentHost/node/agentService.ts) then persists the agent's title with sourceagentunconditionally.SessionTitleContributionrecords a user rename with sourceuser, 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