Skip to content

bug: /restart fails in sessions created with -w #4493

Description

@mingley

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sessionsSession management, resume, history, session picker, and session state

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions