bug: /restart fails in sessions created with -w
未关闭
还没有人认领这个 Issue。
area:sessions
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 /restart 的处理以及使用 copilot -w 启动的会话的命令构造入手。按照 issue 中的三个步骤重现冲突,并检查 -w 和 --session-id 是如何组合的。当 /restart 能够恢复当前会话,同时保留生成的 worktree 且不再发生选项冲突时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100