github / github/copilot-cli

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands.

Đang mở
#4,482 1 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

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands. /add-dir with the identical path fixes it for the session.

Startup log says it loaded:
[INFO] permissions::api_orchestrator] Applied persisted allowed directories {"count":2,"location_key":"..."} 
Probable cause: in app.js, addAdditionalDirectory() is only called inside the paths.add handler. hydrate_location_permission_directories applies persisted dirs to the native permission service but never performs that sync, so the path gate used for shell commands doesn't see them.
Secondary: the prompt's "Yes, and add these directories to the allowed list" option maps to {kind:"approve-for-session"} — the wording implies persistence it doesn't have.

Affected version

GitHub Copilot CLI 1.0.79.

Steps to reproduce the behavior

Repro: add an absolute dir to allowed_directories under a location key; start a session whose git root is that key; run a shell command reading a file under that dir → prompt appears. Run /add-dir  → no more prompts.

Expected behavior

No response

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 trong app.js, so sánh addAdditionalDirectory() trong handler của paths.add với hydrate_location_permission_directories và đường dẫn khởi động của các thư mục đã được lưu. Tái hiện với một mục allowed_directories tuyệt đối, sau đó chạy một lệnh shell đọc một tệp bên trong mục đó. Được xem là hoàn tất khi các thư mục đã được lưu ngăn prompt đường dẫn như /add-dir, và cách diễn đạt của prompt phản ánh chính xác việc phê duyệt chỉ có hiệu lực trong phiê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ệ
javascript, shell
Lĩnh vực
cli, security
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
68/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.