Multi-Repo Workspace Causes Agent turns to terminate early

Same problem here move_agent_to_root aborts the in-flight turn and never resumes (“Switching workspace root”, then silence)

Repro

  1. Open a multi-root .code-workspace (or any workspace whose environment.id is not the single-folder id of repo A).

  2. Start a local Agent chat. Give it a task in repo A.

  3. Let the agent call MCP cursor-app-control / move_agent_to_root with rootPath = repo A (even if A is already in the workspace).

  4. Observe: “Switching workspace root” → generation ends cancelled → new workbench may open on repo A → no agent.turn.start on the new composer.

    Worktree on a local-only feat/* (never pushed) → git fetch origin <branch> → Remote branch not found on origin.

  5. Calling the tool mid-turn (the common case: the tool itself is the in-flight MCP call).

I made another issue with the full detail of the bug and some analysis of the underlying code causing it so that cursor devs can fix this