Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory
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 bug
When using Claude Opus, it will occasionally cd into a lower directory and then access a sibling directory using the relative parent directory shortcut (..). This will inevitably be flagged by Copilot CLI as going outside of the project directory, which is clearly incorrect. Rather than assuming .. is going out of the project directory, Copilot CLI should be getting the absolute directory and checking that.
Affected version
Copilot v1.0.80
Steps to reproduce the behavior
Example issue:
- Start Copilot CLI in
/work. - Ask Claude to review code with a deep directory structure.
- Claude will use something like the following command:
cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4 - The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add
../subfolder4to my "allowed" directories, which is not secure. If it was added to the "allowed" directories, it actually could do it at the top level.
Expected behavior
The CLI should be converting relative addressing to absolute addressing and checking the full path.
Additional context
No response
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 tái hiện lệnh đã được báo cáo từ một phiên Copilot CLI có thư mục gốc là /work, đặc biệt là đường dẫn tương đối ../subfolder4 sau khi thay đổi thư mục. Theo dõi bước kiểm tra quyền truy cập workspace của CLI và xác minh rằng nó phân giải đường dẫn của lệnh trước khi so sánh. Được xem là hoàn tất khi một mục cùng cấp trong workspace được chấp nhận mà không có lời nhắc allow-list, trong khi một đường dẫn thực sự bên ngoài vẫn bị từ chố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, 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
- 66/100