github / github/copilot-cli

bug: /restart fails in sessions created with -w

Open
#4,493 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:sessions
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Describe the bug

A Copilot CLI session started with copilot -w cannot recover after running /restart inside the session. The restart attempts to use both the worktree option and the existing session ID, which results in an option conflict.

Affected version

1.0.80

Steps to reproduce the behavior
  1. From any Git repository, start Copilot CLI with an automatically created worktree:

    $ copilot -w
    Created worktree at /path/to/repo.worktrees/<generated-name> (branch <generated-name>)
    
  2. Inside the session, run /restart.

  3. Observe the error:

    error: option '-w, --worktree[=name]' cannot be used with option '--session-id <id>'
    
Expected behavior

/restart should restart or resume the current session successfully while retaining the existing worktree, without passing -w in conflict with --session-id.

Additional context
  • Operating system: macOS
  • Shell: zsh
  • The session was started with the bare -w option, allowing Copilot CLI to generate the worktree name.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /restart handling and the command construction for sessions launched with copilot -w. Reproduce the conflict using the issue's three steps and inspect how -w and --session-id are combined. Done means /restart resumes the current session while retaining the generated worktree without the option conflict.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.