github / github/copilot-cli

Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory

オープン
#4,601 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:permissions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

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:

  1. Start Copilot CLI in /work.
  2. Ask Claude to review code with a deep directory structure.
  3. Claude will use something like the following command: cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4
  4. The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add ../subfolder4 to 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、ルートが /work の Copilot CLI セッションで報告されたコマンドを再現します。特に、ディレクトリを変更した後の相対パス ../subfolder4 を確認します。CLI のワークスペースアクセスチェックを追跡し、比較の前にコマンドのパスを解決していることを確認します。ワークスペース内の兄弟が allow-list プロンプトなしで受け入れられ、一方で実際に外部にあるパスが引き続き拒否されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli, security
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
66/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。