github / github/copilot-cli

allowed_directories in permissions.config is never loaded

Đang mở
#4,398 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:configuration area:permissions
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

I have several directories listed in my permissions-config for various workspaces. They are never loaded. I can run /list-dirs and never see them.

{
  "locations": {
    "/workspaces/cbreymdev": {
      "allowed_directories": [
        "/opt/test",
        "/tmp"
      ]
    },
...

still results in:

Allowed directories for file access:

1. /workspaces/cbreymdev
2. /tmp
3. /home/vscode/.copilot/installed-plugins
Affected version

1.0.79-6

Steps to reproduce the behavior
  1. sudo mkdir /opt/test
  2. sudo chmod a+rwx /opt/test
  3. mkdir /opt/test/workspace
  4. mkdir /opt/test/subject
  5. echo "Can you read me?" > /opt/test/subject/file.txt
  6. jq '.locations += {"/opt/test/workspace": { "allowed_directories": [ "/opt/test/subject"] }}' ~/.copilot/permissions-config.json > /tmp/permissions-config.json
  7. cp /tmp/permissions-config.json ~/.copilot/permissions-config.json
  8. cd /opt/test/workspace
  9. run copilot interactively
  10. prompt /list-dirs. Observe that "/opt/test/subject" is not present.
  11. prompt "What does /opt/test/subject/file.txt" contain?. Observe a permission prompt.
Expected behavior

In step 10, the listing should container /opt/test/subject.
In step 11, it should report the contents of /opt/test/subject/file.txt

Additional context

No response

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 lần theo cách ~/.copilot/permissions-config.json được tải khi CLI khởi động, sau đó theo dõi dữ liệu được /list-dirs sử dụng. Tái hiện vấn đề với cấu hình jq được cung cấp và các bước workspace. Được xem là hoàn tất khi allowed_directories từ vị trí đang hoạt động xuất hiện trong /list-dirs và cho phép đọc tệp được liệt kê mà không cần thêm lời nhắc cấp quyền.

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
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
65/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.