Windows sandbox: git status fails with working-directory permission denied despite allowed paths
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
Copilot CLI continues to encounter filesystem access denials after I updated sandbox settings to allow access, including C:\Users\vineset . The effective policy has not been verified, so this may be a sandbox policy-application or process working-directory issue.
Environment: Windows; Copilot CLI 1.0.81-1 .
Steps to reproduce:
- Open a CLI session in a Git repository on the D: drive.
- Configure sandbox read/write permissions to allow the required paths.
- Ask the agent to run git -C "D:<repo>" status --short --branch .
- Update the sandbox permissions and retry in the same session.
Expected: Git reads the allowed repository and returns its status.
Actual: Every attempt fails with exit code 128:
fatal: Unable to read current working directory: Permission denied
Supporting observations:
- PowerShell successfully listed the repository and confirmed that .git exists.
- An earlier process-launch error reported C:\ as its working directory, although the session was configured for the repository on D:.
- Plugin management also failed to initialize logging because access to a file under %LOCALAPPDATA%\agency\logs was denied.
- The Git error does not identify the blocked path, making it difficult to determine which permission is missing.
Impact: Unable to run even read-only Git status operations; repository updates and plugin management are also blocked.
Please investigate: Whether tool processes inherit the correct working directory, whether sandbox setting changes reach subsequent processes in the current session, and whether an additional restriction overrides the configured allowed paths. If a restart is required, please make that explicit in the settings UI. Denial messages should identify the affected path and policy rule.
Uncertainty: The exact root cause is not established, and reproduction after a full CLI restart has not been confirmed.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 D: 驱动器上的仓库中重现 Windows CLI 会话,并运行报告中的 git -C "D:<repo>" status --short --branch 命令。比较继承的工作目录、同一会话中与重启后 sandbox 权限的变化,以及对 %LOCALAPPDATA%\agency\logs 的访问。完成的标准是已确定原因,并且拒绝消息或设置行为明确说明所需路径和重启状态。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, powershell, shell
- 领域
- cli, security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 需要澄清
- 新手友好度
- 38/100