Skip to content

Test: Continue a Copilot CLI session in VS Code with /code #342466

Closed

Description

Refs: #342120

Complexity: 3

Authors: Karthik Nadig (@karthiknadig)

Create Issue


/code-insiders in the Copilot CLI hands the current session to VS Code Insiders. The CLI exits, and the session opens in the Chat view of its folder's window, with its history, model and modes.

Setup

Steps

  1. Quit VS Code Insiders. Run copilot in the folder. Pick a non-default model and effort with /model, switch to plan mode (Shift+Tab), run /allow-all, and send a message.
  2. Run /code-insiders. If it lists settings that can't carry over, confirm. The CLI says it's opening the session in VS Code Insiders Chat, shows copilot --resume=<id>, and exits. Accept VS Code's prompt to open the folder.
  3. Check that the Chat view shows the session's history, with Plan, Allow all, and the CLI's model and effort selected. Send a message: the conversation continues.
  4. Repeat steps 1–3 with Insiders already running. With the folder open, that window is focused. Without it, a new window opens and other windows are left alone.
  5. Quit Insiders. Run copilot --resume=<id>, send a message, and leave the CLI running. Open vscode-insiders://file/<folder>?windowId=_blank&copilotCliSession=<id> (Start-Process "<link>" in PowerShell, open "<link>" on macOS, xdg-open "<link>" on Linux). VS Code warns that the session is open in another process. Cancel opens nothing; open the link again and Open Anyway opens it. Then exit the CLI.

Known limitations

  • Windows opened on a .code-workspace file aren't targeted.
  • If you go back to the CLI and run /code again while Insiders is still running, Insiders shows its earlier copy of the session, without the new CLI turns.
  • Permissions given only when the CLI was launched (--allow-all-tools, --allow-tool, /add-dir) and session approvals don't carry over. /code lists them before handing off.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions