fix(agent): a Windows PC without Git gets the agent's own MinGit #62

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/windows-mingit into main 2026-11-16 11:40:34 +00:00
Owner

Why

AstraLol's Windows PC (#518) failed every job at its first git command. Since #56 the farm can see why:

the agent failed: Win32Exception: An error occurred trying to start process 'git' … The specified file was not found.

Windows has no git of its own. The agent needs git outside the sandbox, for the clone and the fetches, and inside it, because dev_packs.py asks git which files a pull request changed.

What changed

  • MinGit: when no git.exe is on the PATH, the agent fetches Git for Windows' MinGit, its portable command-line git, into <data>\mingit.
    • It's version 2.56.0.windows.4, from Git for Windows' own GitHub release, pinned by size and SHA-256.
    • The download is cached in <data>\.cache\mingit, and a stamp file means it isn't fetched again.
    • A PC with git keeps its own.
  • Workspace.GitPath: the agent's own git commands start that git. JobPipeline makes sure of it before a job's first fetch.
  • Sandbox: its PATH and grants fall back to MinGit's folder when the PC's PATH has no git. That folder is now looked up when used, not when the sandbox is made, so a MinGit fetched later is seen.
  • A program that fails to start in HostAsync is now an InfraException naming it, from the process start too, not only from its exit.

Testing

  • Agent checks: 1870 passed, with new ones for the PATH lookup (a quoted folder, none, no PATH) and the pin. dotnet build agent/App -c Release: 0 warnings.
  • I downloaded the pinned zip on this PC: it's 39846926 bytes, its SHA-256 matches, and it holds cmd/git.exe and no entry outside its folder.
  • Not tested on Windows. AstraLol's next try of #518 shows it: its log says "This PC has no Git: downloading Git for Windows' MinGit".
## Why AstraLol's Windows PC (#518) failed every job at its first git command. Since #56 the farm can see why: ``` the agent failed: Win32Exception: An error occurred trying to start process 'git' … The specified file was not found. ``` Windows has no git of its own. The agent needs git outside the sandbox, for the clone and the fetches, and inside it, because `dev_packs.py` asks git which files a pull request changed. ## What changed - **`MinGit`:** when no `git.exe` is on the PATH, the agent fetches Git for Windows' MinGit, its portable command-line git, into `<data>\mingit`. - It's version 2.56.0.windows.4, from Git for Windows' own GitHub release, pinned by size and SHA-256. - The download is cached in `<data>\.cache\mingit`, and a stamp file means it isn't fetched again. - A PC with git keeps its own. - **`Workspace.GitPath`:** the agent's own `git` commands start that git. `JobPipeline` makes sure of it before a job's first fetch. - **Sandbox:** its PATH and grants fall back to MinGit's folder when the PC's PATH has no git. That folder is now looked up when used, not when the sandbox is made, so a MinGit fetched later is seen. - A program that fails to start in `HostAsync` is now an `InfraException` naming it, from the process start too, not only from its exit. ## Testing - Agent checks: 1870 passed, with new ones for the PATH lookup (a quoted folder, none, no PATH) and the pin. `dotnet build agent/App -c Release`: 0 warnings. - I downloaded the pinned zip on this PC: it's 39846926 bytes, its SHA-256 matches, and it holds `cmd/git.exe` and no entry outside its folder. - **Not tested on Windows.** AstraLol's next try of #518 shows it: its log says "This PC has no Git: downloading Git for Windows' MinGit".
fix(agent): a Windows PC without Git gets the agent's own MinGit
Some checks are pending
CI / Coordinator tests (pull_request) Waiting to run
CI / Agent build and checks (pull_request) Waiting to run
CI / Coordinator image (pull_request) Waiting to run
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
4ca2421182
On one tester's PC every job stopped at its first git command ("An error
occurred trying to start process 'git'"): Windows has no git of its own,
and the agent needs it outside the sandbox (the clone, the fetches) and in
it (dev_packs.py asks git what a pull request changed). When git is not on
the PATH, the agent now fetches Git for Windows' MinGit 2.56.0.windows.4,
pinned by size and SHA-256, into <data>\mingit, and uses it for its own git
commands and on the sandbox's PATH. A git that fails to start is now an
InfraException that names it.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/windows-mingit 2026-11-16 11:40:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!62
No description provided.