Make `--name` create or resume a session
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
Describe the feature or problem you'd like to solve
copilot --name <name> creates a new named session, but it does not resume an existing session with that name. After the first launch, users and automation must know whether the session exists before selecting --name <name> or --resume <name>.
The same distinction breaks CLI relaunches. A session started with copilot --name project-a can fail during /update when the replacement process receives both the original --name and an internal --session-id:
error: option '-n, --name <name>' cannot be used with option '--session-id <id>' when it resolves to an existing or remote session or task.
--name only names a brand-new session created by --session-id=<new-uuid>; the resolved session was not renamed.
Proposed solution
Give copilot --name <name> create-or-resume behavior. --name should use the same name lookup and matching rules as --resume <name>:
- If no session matches, create a session with that name.
- If exactly one session matches, resume that session.
- If multiple sessions match, follow the current
--resume <name>ambiguity behavior. Do not create another session. - Resume the selected session when
/restart,/update, or another command relaunches the CLI. A retained--nameshould not fail because the session now exists or because the relaunch also carries an internal session ID.
--resume should remain available for three uses: session IDs, the session picker, and existing workflows. Users and automation could then use one repeatable command whenever a stable name identifies the session.
Example prompts or workflows
- The first
copilot --name project-ainvocation creates a named session. - A later
copilot --name project-ainvocation resumes that session. /updateor/restartresumes that session without a flag conflict.- An alias or script can keep invoking
copilot --name project-awithout first querying session state.
Additional context
Issue https://github.com/github/copilot-cli/issues/3332 reports /restart failing in a session created with --name. The requested semantics address that failure and the broader need for one repeatable name-based command.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cách CLI xử lý --name và --resume, sau đó kiểm tra các đường dẫn khởi chạy lại được /restart và /update sử dụng. So sánh hành vi với issue #3332 và xác minh bốn trường hợp được đề xuất: tạo khi không có kết quả khớp, tiếp tục khi có một kết quả khớp, giữ nguyên cách xử lý mơ hồ hiện tại và tránh xung đột trong khi khởi chạy lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100