fix(agent): check that git in the sandbox can read the checkout before a build, and say git's own error #110

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/sandbox-git-check into main 2026-11-20 15:25:40 +00:00
Owner

One Windows tester has failed all 79 of its jobs since Nov 18 at the main base, with only this to go on:

subprocess.CalledProcessError: Command '['git', 'rev-parse', '--verify', 'HEAD^{commit}']' returned non-zero exit status 128.

Longshot's packs tool keeps git's stderr to itself, so the report never says why. It was the same with the old dev_packs.py (git -C Z:\longshot diff HEAD, exit 128), so this isn't from the dev.py switch. And each failure took up a job for that PC as if the PR's build had failed.

What changes:

  • Before the base build and before the PR's pack, the agent runs a short Python check in the same sandbox, with the same folders and environment. It runs git rev-parse --verify HEAD^{commit} in the checkout (Workspace.CheckGitAsync).
  • When git can't answer, the job stops as this PC's trouble (InfraException, not passing), and the job goes to another tester. The error carries git's own last lines, the exit code, whether Python can read .git, .git/HEAD and .git/objects there, and git's version. It also tells the tester the command to try themselves.
  • If the check can't run, or prints nothing (a test's sandbox), the build goes ahead as before. A good checkout costs one quick extra sandbox start.

Tests: a new "git check" group in the agent core checks:

  • a refusal stops the job at the right stage, as an infra error with git's words and without the probe's markers;
  • the check runs in the checkout, with the build's home and folders, without a GPU;
  • an "ok" answer or a silent sandbox lets the build go on.

The embedded Python passes ast.parse. Nothing was built or run on this PC, so CI builds and runs the checks on Linux and Windows.

The docs' agent pipeline (docs/architecture.md, step 3) mentions the check.

πŸ€– Generated with Claude Code

One Windows tester has failed all 79 of its jobs since Nov 18 at the main base, with only this to go on: ``` subprocess.CalledProcessError: Command '['git', 'rev-parse', '--verify', 'HEAD^{commit}']' returned non-zero exit status 128. ``` Longshot's packs tool keeps git's stderr to itself, so the report never says why. It was the same with the old `dev_packs.py` (`git -C Z:\longshot diff HEAD`, exit 128), so this isn't from the `dev.py` switch. And each failure took up a job for that PC as if the PR's build had failed. **What changes:** - Before the base build and before the PR's pack, the agent runs a short Python check in the same sandbox, with the same folders and environment. It runs `git rev-parse --verify HEAD^{commit}` in the checkout (`Workspace.CheckGitAsync`). - When git can't answer, the job stops as this PC's trouble (`InfraException`, not passing), and the job goes to another tester. The error carries git's own last lines, the exit code, whether Python can read `.git`, `.git/HEAD` and `.git/objects` there, and git's version. It also tells the tester the command to try themselves. - If the check can't run, or prints nothing (a test's sandbox), the build goes ahead as before. A good checkout costs one quick extra sandbox start. **Tests:** a new "git check" group in the agent core checks: - a refusal stops the job at the right stage, as an infra error with git's words and without the probe's markers; - the check runs in the checkout, with the build's home and folders, without a GPU; - an "ok" answer or a silent sandbox lets the build go on. The embedded Python passes `ast.parse`. Nothing was built or run on this PC, so CI builds and runs the checks on Linux and Windows. The docs' agent pipeline (`docs/architecture.md`, step 3) mentions the check. πŸ€– Generated with [Claude Code](https://claude.com/claude-code)
fix(agent): check that git in the sandbox can read the checkout before a build, and say git's own error
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 3s
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 11s
344b6642bf
One Windows tester failed all 79 of its jobs at the main base with only
"git rev-parse ... returned non-zero exit status 128": the packs tool's
traceback drops git's stderr. Before the base and the PR's pack, the agent
now asks git in the sandbox for the checkout's commit. When git can't
answer, the job stops as this PC's trouble (InfraException) with git's own
words, the exit, which .git folders Python can read and git's version, and
goes to another tester.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #93 fix(agent): skip git shims on PATH and check git in Windows self-test β€” Open overlapping sandbox git verification and Windows shim fix
  • issue #92 Windows: AppContainer sandbox breaks when git on PATH is a shim (Scoop) β€” Open issue on Windows sandbox git checkout failures
  • issue #35 Windows AppContainer: Python private temporary directories exclude the package SID β€” Prior Windows sandbox base-build failure; possibly overlaps but distinct temp ACL cause
Possibly related, for context: - PR #93 fix(agent): skip git shims on PATH and check git in Windows self-test β€” Open overlapping sandbox git verification and Windows shim fix - issue #92 Windows: AppContainer sandbox breaks when git on PATH is a shim (Scoop) β€” Open issue on Windows sandbox git checkout failures - issue #35 Windows AppContainer: Python private temporary directories exclude the package SID β€” Prior Windows sandbox base-build failure; possibly overlaps but distinct temp ACL cause
HumanBean changed title from WIP: fix(agent): check that git in the sandbox can read the checkout before a build, and say git's own error to fix(agent): check that git in the sandbox can read the checkout before a build, and say git's own error 2026-11-20 15:25:37 +00:00
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!110
No description provided.