Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Two problems, one report. The second is the one that actually hurts.
-
When an agent calls the cursor-app-control tool
move_agent_to_rootwith a folder that is already a root of a named.code-workspace, Cursor creates a SECOND workspace identity for the same tree, so the Agents sidebar grows a duplicate section with an identical label. -
There is no way to merge two sidebar sections that represent the same thing. No UI action, no tool, no supported edit. Once the duplicate exists it is permanent, and one project’s chats stay split across two sections forever.
The missing capability: merging sidebar entries
This is the fix I am asking for. Today the only suggestions are “Remove from Sidebar” (which hides a section and its chats, and per /t/166321 comes back after new activity) and “open it the same way from now on” (which does nothing for the chats already stranded on the other identity). Per that same thread, sidebar sections are grouped live from each chat’s workspace identity rather than from stored state, so editing state.vscdb cannot fix it either. That leaves users with no path at all.
What is needed, in rough order of preference:
- Merge two sections: pick a target identity, re-point every chat bound to the duplicate, retire the source. This is the operation users actually want and it does not exist in any form.
- Re-point a single chat to another workspace identity, so a chat created under the wrong identity can be filed correctly.
- Alias two workspace identities as one, so both resolve to a single section at render time without touching chat records.
Duplicate identities are created by several different bugs (Save As, add-folder, path migration, remote-SSH URI encoding, and move_agent_to_root - see related threads at the end). Each of those gets fixed individually while the wreckage they already produced stays on screen permanently. A merge action would fix all of them at once, including cases you have not found yet.
How the duplicate gets created
move_agent_to_root accepts folders only (rootPath / rootPaths); it cannot target a .code-workspace file. So any agent that “moves into the project” - the documented Home-window flow, not an edge case - necessarily mints a folder identity for a tree whose canonical identity is a workspace file. Passing two or more folders is worse: Cursor synthesizes an auto-named file in glassMultiRootWorkspaces, which becomes a third identity with a machine-concatenated label.
The two identities are visible in workspaceMetadata.entries in the global state.vscdb: one entry carries configPath pointing at the .code-workspace file (multi-root), the other carries folderUri for the single folder. Both sections render with the same label, because a multi-root section is labeled with the workspace file stem and a single-root section with the folder basename, and when those two strings match the sections are indistinguishable except by icon.
A related case leaves a third section behind: an auto-named workspace generated into glassMultiRootWorkspaces keeps its sidebar section even after that file has been deleted from disk.
Steps to Reproduce
- Author
Foo.code-workspacelisting folderC:\src\Foo(plus a second root) and open it via File → Open Workspace from File. Chats created here bind to the workspace-file identity. - Start an agent chat in the Home / empty window.
- Give it work that clearly belongs to Foo, so the harness calls
move_agent_to_root({ rootPath: 'C:\\src\\Foo' }). - Look at the Agents sidebar: there are now two sections both labeled
Foo, each holding different chats. One is the workspace-file identity, one is the folder identity. - Try to merge them. There is no way to do it - no context-menu action, no setting, and per /t/166321 no storage edit either, because sections are grouped live from each chat’s workspace identity.
Expected Behavior
Two things.
-
There should be a way to merge or re-point Agents sidebar sections. Pick the section that should survive, move every chat from the duplicate onto it, retire the duplicate. Duplicate workspace identities arise from several unrelated bugs, so a single merge action is worth more than fixing each cause in isolation - it also repairs the damage those causes already did.
-
move_agent_to_rootshould not create a new identity for a tree that already has one. Either let it accept a.code-workspacepath, or have it resolve a folder to an existing workspace identity whose roots already contain that folder, and only create a new identity when no existing one covers it.
Workarounds that do not work:
- “Remove from Sidebar” hides the section along with its chats, and per /t/166321 it reappears after new activity.
- Switching the sidebar grouping from Workspace to Repository only merges identities that resolve to the same git repo. It does nothing for folders that are not git working copies (other version control systems), which have no repo identity to group on.
- Editing local storage does nothing, since sections are computed live from each chat’s workspace identity.
Related threads:
- /t/166321 - Agents sidebar shows multiple identical sections for one local repo after path migration
- /t/171560 - Multi-root workspace: Save As / rename creates duplicate workspace
- /t/171949 - Adding folder to existing workspace creates a new workspace
- /t/165458 - Duplicate workspaces and duplicate repo groups for the same remote folder
Operating System
Windows 10/11
Version Information
Version: 3.21.9 (stable)
Commit: d5c0e77a0214208f36b56d42e8e787de88d02ea4
OS: Windows
Does this stop you from using Cursor
No - Cursor works, but with this issue