github / github/copilot-cli

add-dir flag converts dashes to underscores in paths causing permission loop for OneDrive directories

Offen
#1,409 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:permissions
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Describe the bug

The Copilot CLI converts dashes to underscores when processing add-dir path values internally. This creates a mismatch between the granted directory path and the actual filesystem path, causing repeated permission prompts that never resolve.

This matters on Windows because the default enterprise OneDrive sync folder is named "OneDrive - Microsoft" which is set by the Windows sync client and not easily changed. Any workflow storing workspaces in OneDrive hits this bug.

The only workaround is allow-all-paths which grants full filesystem access and defeats the security purpose of add-dir scoping

### Affected version

v0.0.407-1

### Steps to reproduce the behavior

1. On Windows, confirm your OneDrive sync folder uses the default enterprise name: C:\Users\username\OneDrive - Microsoft\
2. Create a workspace folder inside it, for example: C:\Users\username\OneDrive - Microsoft\MyWorkspace
3. Launch Copilot CLI with that directory added: copilot -i "Hello" --add-dir "C:/Users/username/OneDrive - Microsoft/MyWorkspace"
4. The CLI prompts for permission to access the directory. Accept it.
5. The CLI prompts again and keeps prompting. The permission grant never sticks because the path is internally stored with underscores instead of dashes, so it never matches the real directory.

### Expected behavior

The add-dir path should be preserved exactly as provided for permission matching. Accepting the directory prompt once should grant access without further prompts.

### Additional context

Copilot CLI version: 0.0.407-1
OS: Windows 11
Shell: PowerShell 7
OneDrive path: C:\Users\username\OneDrive - Microsoft\ (default enterprise M365 sync folder name)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.