Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory
Personne n'a encore pris cette issue.
- 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 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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire la commande signalée depuis une session Copilot CLI dont le répertoire racine est /work, en particulier le chemin relatif ../subfolder4 après avoir changé de répertoire. Suivez la vérification de l’accès au workspace de la CLI et vérifiez qu’elle résout le chemin de la commande avant la comparaison. C’est terminé lorsqu’un élément frère situé dans le workspace est accepté sans invite d’allow-list, tandis qu’un chemin réellement externe est toujours rejeté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- shell
- Domaine
- cli, security
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 66/100