fix(agent): Windows always uses the agent's own MinGit, never the PC's git #122

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/always-mingit into main 2026-11-20 19:42:01 +00:00
Owner

Summary

On some Windows PCs every job stopped before its build: git in the AppContainer died at once with fatal: could not open '/dev/null' for reading and writing: Permission denied, and the message blamed the checkout folder's permissions. git opens /dev/null (NUL) as it starts, before any command, so even git --version died; the .git folders were readable. Three PCs in the last three days (one of Flashman4's two, dogty's, and a BigBean's scheduled run), 30 tries; every other Windows tester's git ran in the same AppContainer. The sandbox used the first git.exe on the PC's PATH, which can be anything.

  • Always the agent's MinGit on Windows (Workspace.EnsureGitAsync, WinHost.Git): the agent's own git commands and its sandboxes use the pinned MinGit 2.56.0.windows.4 (fetched once into <data>\mingit, its size and SHA-256 checked), never the PC's git. PCs without git already got it; now every PC does.
  • The git check's words (Workspace.GitCheckWords): git that can't open /dev/null is said to fail to start in the sandbox, not blamed on the folder.
  • The self-test's git line names the agent's MinGit, or none yet (the first job fetches it).

Testing

Tested: in a mcr.microsoft.com/dotnet/sdk:10.0 container on the farm's server (not a tester's PC): dotnet build agent/Beanstalk.Agent.slnx -c Release -p:RestoreLockedMode=true with 0 warnings and 0 errors, and agent/tests/test_agent_core.py --strict: 2260 checks passed (git check: 16, with a new case: git without /dev/null stops the job with "git can't start in the sandbox" and doesn't blame the folder).

Still to test: Windows, after the next nightly: a job on one of the PCs that had the error builds.

πŸ€– Generated with Claude Code

## Summary On some Windows PCs every job stopped before its build: git in the AppContainer died at once with `fatal: could not open '/dev/null' for reading and writing: Permission denied`, and the message blamed the checkout folder's permissions. git opens /dev/null (NUL) as it starts, before any command, so even `git --version` died; the `.git` folders were readable. Three PCs in the last three days (one of Flashman4's two, dogty's, and a BigBean's scheduled run), 30 tries; every other Windows tester's git ran in the same AppContainer. The sandbox used the first git.exe on the PC's PATH, which can be anything. - **Always the agent's MinGit on Windows** (`Workspace.EnsureGitAsync`, `WinHost.Git`): the agent's own git commands and its sandboxes use the pinned MinGit 2.56.0.windows.4 (fetched once into `<data>\mingit`, its size and SHA-256 checked), never the PC's git. PCs without git already got it; now every PC does. - **The git check's words** (`Workspace.GitCheckWords`): git that can't open /dev/null is said to fail to start in the sandbox, not blamed on the folder. - **The self-test's git line** names the agent's MinGit, or none yet (the first job fetches it). ## Testing **Tested:** in a `mcr.microsoft.com/dotnet/sdk:10.0` container on the farm's server (not a tester's PC): `dotnet build agent/Beanstalk.Agent.slnx -c Release -p:RestoreLockedMode=true` with 0 warnings and 0 errors, and `agent/tests/test_agent_core.py --strict`: 2260 checks passed (git check: 16, with a new case: git without /dev/null stops the job with "git can't start in the sandbox" and doesn't blame the folder). **Still to test:** Windows, after the next nightly: a job on one of the PCs that had the error builds. πŸ€– Generated with [Claude Code](https://claude.com/claude-code)
fix(agent): Windows always uses the agent's own MinGit, never the PC's git
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 4s
CI / Coordinator tests (pull_request) Failing after 1m24s
CI / Agent build and checks (pull_request) Successful in 40s
CI / Coordinator image (pull_request) Successful in 9s
949a0029b5
On some Windows PCs every job stopped before its build: git in the AppContainer
died at once with "fatal: could not open '/dev/null' for reading and writing:
Permission denied" (git opens /dev/null as it starts, before any command), and
the message blamed the checkout folder's permissions. Three PCs in Nov 2026
(one of Flashman4's, dogty's, a BigBean's scheduled run), 30 tries in 3 days;
every other Windows tester's git ran. The sandbox took the first git.exe on the
PC's PATH, which can be anything.

- Workspace.EnsureGitAsync and WinHost.Git: on Windows the agent's commands
  and its sandboxes always use the agent's pinned MinGit (fetched once into
  <data>\mingit, its size and SHA-256 checked), never the PC's git.
- The git check's words: git that can't open /dev/null is said to fail to
  start in the sandbox, not blamed on the folder (Workspace.GitCheckWords).
- The self-test's git line names the agent's MinGit, or none yet.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP: fix(agent): Windows always uses the agent's own MinGit, never the PC's git to fix(agent): Windows always uses the agent's own MinGit, never the PC's git 2026-11-20 19:41:59 +00:00
HumanBean deleted branch fix/always-mingit 2026-11-20 19:42:02 +00:00
Member

Possibly related, for context:

  • issue #92 Windows: AppContainer sandbox breaks when git on PATH is a shim (Scoop) β€” Same underlying issue: host PATH git failing in AppContainer; this PR switches all Windows jobs to pinned MinGit.
  • issue #111 Two Windows testers fail every job before building, with the sandbox unable to read the job's working directory β€” Open Windows jobs failing at git startup; this PR may address their git-specific failures.
  • PR #93 fix(agent): skip git shims on PATH and check git in Windows self-test β€” Merged prior fix handles PATH git shims; this PR supersedes it by always using MinGit.
  • PR #62 fix(agent): a Windows PC without Git gets the agent's own MinGit β€” Merged MinGit fallback; this broadens it to use MinGit even when PC git exists.
Possibly related, for context: - issue #92 Windows: AppContainer sandbox breaks when git on PATH is a shim (Scoop) β€” Same underlying issue: host PATH git failing in AppContainer; this PR switches all Windows jobs to pinned MinGit. - issue #111 Two Windows testers fail every job before building, with the sandbox unable to read the job's working directory β€” Open Windows jobs failing at git startup; this PR may address their git-specific failures. - PR #93 fix(agent): skip git shims on PATH and check git in Windows self-test β€” Merged prior fix handles PATH git shims; this PR supersedes it by always using MinGit. - PR #62 fix(agent): a Windows PC without Git gets the agent's own MinGit β€” Merged MinGit fallback; this broadens it to use MinGit even when PC git exists.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!122
No description provided.