github / github/copilot-cli

Permissions for non-existing directories are handled incorrectly

未关闭
#2,611 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:configuration area:permissions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

When instructing Copilot to run `docker exec -w /my/workdir mycontainer my_command`, it asks for permission for directory /my/workdir.

This is questionable behavior, because this is not a directory for the local machine, it's a directory on the container, but that's a separate topic for discussion. Let's say I want to tell Copilot to always allow this directory and not ask me for permissions:
```copilot --model gpt-5-mini --add-dir=/my/workdir -p 'Run this command: `docker exec -w /my/workdir mycontainer my_command`'```

This command fails: "Error executing prompt: Error: Directory does not exist or cannot be accessed: /my/workdir"

I guess Copilot expects this directory to exist on the local machine? But again, this is not a local directory. So Copilot's behavior is inconsistent, confusing, and provides no alternatives besides --yolo

### Affected version

GitHub Copilot CLI 1.0.22.

### Steps to reproduce the behavior

```copilot --model gpt-5-mini --add-dir=/my/workdir -p 'Run this command: `docker exec -w /my/workdir mycontainer my_command`'```

### Expected behavior

Expected one of 2 things:
* /my/workdir would be added to allowed directories, despite not existing locally
* or, maybe permissions for /my/workdir shouldn't be required in the first place, since this is a directory on the container, not a local one

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。