bug: /restart fails in sessions created with -w
Nobody has claimed this yet.
- 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
-
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>) -
Inside the session, run
/restart. -
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
-woption, allowing Copilot CLI to generate the worktree name.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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