github / github/copilot-cli

Codespaces ships Copilot CLI 1.0.3 and `copilot update` only installs with `sudo`

Đang mở
#4,501 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:installation area:platform-linux
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 bug

A newly opened GitHub Codespace starts with GitHub Copilot CLI 1.0.3 installed at /usr/local/bin/copilot.

Running copilot update reports that version 1.0.80 was downloaded, but the installed binary is not replaced and copilot --version continues to report 1.0.3, even after opening a new terminal or restarting the Codespace.

Running sudo copilot update does successfully install the update. This indicates that the normal updater cannot replace the root-owned binary in /usr/local/bin, but still prints a success message.

Affected version
  • Preinstalled version in the Codespace: 1.0.3
  • Version reported as downloaded by the updater: 1.0.80
Steps to reproduce the behavior
  1. Open a GitHub Codespace.
  2. Run copilot --version and confirm that it reports GitHub Copilot CLI 1.0.3.
  3. Run copilot update.
  4. Observe the message: Copilot CLI version 1.0.80 downloaded.
  5. Run copilot --version again.
  6. Open a new terminal or restart the Codespace and run copilot --version again.
  7. Run sudo copilot update and observe that the update succeeds.
Actual output
$ copilot --version
GitHub Copilot CLI 1.0.3.
Run 'copilot update' to check for updates.

$ copilot update
Checking for updates...
Copilot CLI version 1.0.80 downloaded.

$ copilot --version
GitHub Copilot CLI 1.0.3.
Run 'copilot update' to check for updates.

The version remains 1.0.3 after opening a new terminal and after restarting the Codespace. The update succeeds only when run as sudo copilot update.

Investigation
  • which -a copilot returns a single path: /usr/local/bin/copilot.
  • ls -la /usr/local/bin/copilot shows that the file is still dated March 9 after the non-sudo update, so the installed binary was not overwritten.
  • The normal updater appears unable to write to the root-owned /usr/local/bin/copilot binary.
  • Despite not replacing the binary, it prints a successful download message instead of reporting the installation failure.
  • Running sudo copilot update successfully performs the update.
Expected behavior
  1. New GitHub Codespaces should start with the current supported stable Copilot CLI version (1.0.80 at the time of this report, or the latest stable version), rather than the outdated 1.0.3 binary.
  2. copilot update should actually replace the installed binary.
  3. If the updater cannot write to /usr/local/bin/copilot, it should exit with a non-zero status and clearly explain that elevated permissions are required, for example by suggesting sudo copilot update.
  4. It should not display a success message unless the installed binary has been replaced and the new version can be verified.
Workaround
$ sudo copilot update
Environment
  • GitHub Codespaces (devcontainer)
  • Linux Codespace
  • Initial Copilot CLI version: 1.0.3
  • Update version reported by the CLI: 1.0.80
  • Installed binary: /usr/local/bin/copilot
  • Exact uname -a output was not captured
Related issue
  • #4405 — the stale preinstalled binary and failed non-sudo update prevented verification with the newer CLI version suggested there.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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 tái hiện copilot update trong một GitHub Codespace và kiểm tra entry point của copilot update cùng với việc cài đặt tại /usr/local/bin/copilot. So sánh các lần chạy thông thường và chạy với sudo, bao gồm trạng thái thoát và đầu ra phiên bản của chúng. Được xem là hoàn tất khi phiên bản được hỗ trợ có sẵn trong các Codespaces mới, việc thay thế không thành công được báo cáo rõ ràng và chỉ hiển thị thành công sau khi phiên bản đã cài đặt thay đổ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ệ
linux, shell
Lĩnh vực
cli, devops
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.