copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Support `/rename` in VS Code agent sessions, and let the agent invoke it

Open chalin opened this issue 4 months ago • 2 comments

Problem

/rename (added in #1776) works in the terminal CLI, but not for Copilot CLI sessions hosted in VS Code's Agents window:

  • Typing /rename in an agent session's chat has no effect there — renaming is only available through the VS Code UI (verified 2026-07-23).
  • There is no way for the agent itself to rename its session — no tool, and no slash-command it can run.

Proposal

  1. Honor /rename NEW_NAME in VS Code agent sessions, matching the terminal CLI behavior.
  2. Expose rename to the agent (a tool, or agent-invocable /rename), so workflows can set titles programmatically.

Use case

Session-hygiene rituals: I keep many long-running agent sessions and prefix titles with a status word as threads settle — DONE …, PARKED …, CONT'D … — so the session picker doubles as a work board. Today every close-out ends with manual rename homework; an agent-invocable rename would let the close-out workflow set the title itself (and lower-stakes: agents could title sessions descriptively from the start, cf. #3365 on auto-naming).

Notes from poking at the internals

  • A UI rename syncs into ~/.copilot/session-state/UUID/workspace.yaml (name: + user_named:), so agents can already read current titles (verified 2026-07-24).
  • Writing workspace.yaml directly doesn't work as a workaround: VS Code caches session labels elsewhere (workspace state.vscdb, agentSessions.model.cache) and doesn't notice the change.

Related

  • #1776 — added /rename (terminal CLI)
  • #3365 — auto-generated session names not working
  • #3415 — show session name at all times
  • #2966 — broader session-management tooling

chalin avatar Jul 24 '26 13:07 chalin

+1 for this, I have custom instructions in my home environment on Claude Code that cause chats to rename thread titles by state and project with emojis and keep identity up to date. It is IMMENSELY useful for keeping multiple plates spinning and knowing where everything is. It is deeply annoying that this is impossible in github copilot, and a thread where I may be deep in a discussion on topic X is still renamed something like "inspecting initial observations..." from the very first turn and I just have to keep track of that in my brain or manually rename

blawler254 avatar Oct 28 '26 14:10 blawler254

Still broken on VS Code 1.142.0 (commit 6d62b1d5), Copilot CLI agent session, VS Code Server on Linux. This was filed three months ago.

Reproduced tonight, twice in a row:

  1. Type /rename Abruti in the agent session chat.
  2. It is not executed. It is sent to the model as an ordinary prompt.
  3. The auto-titler then names the session from that prompt: the title became Rename Abruti, then Rename Abruti command. workspace.yaml still says user_named: false.
  4. Before and between those attempts the auto-titler renamed the session four more times on its own from conversation content (BPGS definition search, Sleep-related i…, Chat project naming issue, …). The sidebar truncates whatever it picks, so the title can't even be read in full.

So the one command that exists to name a session does nothing in VS Code, its text is fed to the auto-namer instead, and the auto-namer overwrites the title every few turns. The owner of the machine, who pays for the seat, cannot name his own chat. With several parallel agent sessions across projects there is no longer any way to tell which chat belongs to which project. This is not a missing nicety: the product is actively destroying the only organising handle the user has, and replacing it with titles generated from whatever was said last.

None of the fix is hard:

  • /rename is a command in VS Code exactly as in the terminal CLI. It never reaches the model.
  • A user-set title is final. Auto-titling stops permanently once the user has named the session.
  • An off switch for auto-titling, now, until the above ships.
  • A rename tool the agent can call, so user instructions can set titles.
  • Titles are shown in full: the list sizes to the name or wraps, instead of truncating.

Related: #2622 (manual rename overwritten by auto-name), #3415 (show the name at all times), #5158 (name reverts after explicit rename), microsoft/vscode#337278 (rename silently lost).

elfege avatar Oct 31 '26 06:10 elfege