github / github/copilot-cli

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands.

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

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

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

説明

Describe the bug

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands. /add-dir with the identical path fixes it for the session.

Startup log says it loaded:
[INFO] permissions::api_orchestrator] Applied persisted allowed directories {"count":2,"location_key":"..."} 
Probable cause: in app.js, addAdditionalDirectory() is only called inside the paths.add handler. hydrate_location_permission_directories applies persisted dirs to the native permission service but never performs that sync, so the path gate used for shell commands doesn't see them.
Secondary: the prompt's "Yes, and add these directories to the allowed list" option maps to {kind:"approve-for-session"} — the wording implies persistence it doesn't have.

Affected version

GitHub Copilot CLI 1.0.79.

Steps to reproduce the behavior

Repro: add an absolute dir to allowed_directories under a location key; start a session whose git root is that key; run a shell command reading a file under that dir → prompt appears. Run /add-dir  → no more prompts.

Expected behavior

No response

Additional context

No response

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

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

はじめの一歩

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

調査の方向性

app.js から始め、paths.add ハンドラーの addAdditionalDirectory() と hydrate_location_permission_directories、および永続化されたディレクトリの起動パスを比較します。絶対パスの allowed_directories エントリで再現し、その下にあるファイルを読み取る shell コマンドを実行します。永続化されたディレクトリによって /add-dir と同様にパスのプロンプトが抑制され、プロンプトの文言がセッション限定の許可を正確に反映すれば完了です。

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

評価

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

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

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