Local sandbox blocks `git submodule update`, even as a no-op (worked in 1.0.99-2)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- git, github, macos, zsh
- Lĩnh vực
- devtools, documentation, security
Hướng nghiên cứu
Start by tracing how local sandbox policy builds read-only paths for .git metadata, including submodules and linked worktrees, and compare those paths with the documented filesystem permissions. The issue provides a reproduction, an effective policy excerpt, and links to the two documentation pages. Done when either the no-op git submodule update works in the sandbox or the docs clearly describe the read-only paths and their effects.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
With local sandboxing on, git submodule update cannot run in a repository that has initialized submodules, even when every submodule is already at its recorded commit. Any install or build script that calls it fails, so the agent cannot build such a repository inside the sandbox.
This is a change in behavior: 1.0.99-2 runs the same command in the same repository with sandboxing on. I found no changelog entry for it.
The failure:
error: could not write config file <repo>/.git/modules/<submodule>/config: Operation not permitted
fatal: could not set 'core.worktree' to '../../../<submodule>'
Two things combine:
- The effective sandbox policy lists every Git
configfile andhooksdirectory under<repo>/.gitas read-only, including those of each submodule (.git/modules/<submodule>/config) and of each linked worktree. git submodule updaterewritescore.worktreein each submodule's config on every run, whenever the key is already set, so it needs that write even when it has nothing to update. Seeensure_core_worktree; Git'smasterhas the same code.
The documentation does not mention this protection, and says the opposite:
- "Read/write permission to everything in and below the repository's
.gitdirectory." (Configuring local sandbox settings) - "In a Git repository, the repository's Git metadata is also writable" (Using local sandboxing)
Affected version
1.0.117-3. Not affected: 1.0.99-2. Also seen in a VS Code 1.148.0 Agents-window session.
Steps to reproduce the behavior
- Open a repository that has at least one initialized submodule, with local sandboxing enabled.
- Ask Copilot to run
git submodule update --init. - The command exits 128 with the error above, although
git submodule statusshows every submodule at its recorded commit. With sandboxing off, or on 1.0.99-2 with it on, the same command exits 0.
Seen in open-telemetry/opentelemetry.io (ten submodules), where the install, build and test scripts all run git submodule update --init first.
Excerpt of the effective sandbox policy for that repository, from the VS Code session, paths shortened:
## Working directory
### Read-only paths (153)
- <repo>/.git/config
- <repo>/.git/hooks
- <repo>/.git/modules/<submodule>/config
- <repo>/.git/modules/<submodule>/hooks
- <repo>/.git/worktrees/<worktree>/commondir
- <repo>/.git/worktrees/<worktree>/modules/<submodule>/config
- <repo>/.git/worktrees/<worktree>/modules/<submodule>/hooks
- <repo>/<submodule>/.git
### Read-write paths (1)
- <repo>
Expected behavior
One of:
git submodule updateworks inside the sandbox, at least when it has nothing to update, as it did in 1.0.99-2.- The documentation says that Git config files and hook directories under
.gitstay read-only, those of submodules and linked worktrees included, and what that means for commands that write them.
Additional context
- macOS 27.2.1 (26B131), Apple silicon, zsh
- git 2.54.0 (Apple Git-157)
- From the same policy report: sandbox bypass allowed; MCP servers, LSP servers and extensions sandboxed
- No bypass prompt was offered when the command failed, although "Allow sandbox bypass" is on
- Asked about the failure, the CLI agent said its sandbox guidance marks
.git/config,.git/hooksand the configured hooks directory as read-only inside the working directory; it does not name the configs of submodules or linked worktrees, and the user documentation mentions none of these - Git's side reproduces without Copilot: with a submodule's config file made immutable (
chflags uchg),git submodule update --initprints the same two lines in a scratch repository - Workaround in use: read
git submodule status, skip the update when every submodule is in sync, and run the update outside the sandbox when a recorded commit has moved
- Ngôn ngữ chính
- Python
- Star
- 11.5k
- Fork
- 2k
- Merge trung bình
- 6 giờ 34 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/copilot-cli
-
area:plugins
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
github/copilot-cli#5567 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncationĐang mởarea:tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/copilot-cli#5476 ·
-
triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
github/copilot-cli#5340 ·
Tất cả issue của github/copilot-cli
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: Triage Suggestion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Suggestion]: NoParrotĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
collabnix/awesome-mcp-lists#515 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Look-ahead bias via resample('1min').interpolate(method='time') in CCIStrategy and ReinforcedQuickieĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày