Permissions for non-existing directories are handled incorrectly
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
### 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_
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start by reproducing the documented `copilot --add-dir=/my/workdir` command with the Docker `exec -w` prompt. Trace the CLI's directory validation and permission handling for non-existent paths, then add coverage for the reported command and verify that the chosen expected behavior is consistent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- docker, shell
- Domaine
- cli, security
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100