fix(agent): a clone that lacks a fetched commit is cloned again before the job is refused #66

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/reclone-pr-head into main 2026-11-16 12:23:51 +00:00
Owner

Why

Tommy's Windows PC (nightly-124) refused the re-planned Longshot #910 with "the pull request's head is no longer e4609af92ac9", but e4609af92ac9 is #910's head on the forge. The fetch went through and the clone still lacked the commit. Earlier it lacked main's commit too ("main has no commit 02608169e638", after a git checkout killed with 0xC000013A), so the clone is damaged.

#59 clones again only when main's commit is missing. The PR's head was checked first, and its absence was taken as the PR having moved, so the re-clone never ran.

What changed

JobPipeline, for a PR job:

  • After the fetches, if main's commit is still missing, or the PR's is (when the head just fetched is that commit), the clone is damaged. It's removed and cloned again once, and both are fetched again.
  • A PR whose head really moved is still refused, and the message now says what the head is now.
  • A commit missing even in a new clone is an infra error that quotes git cat-file's words.

Testing

  • Agent checks: 1875 passed. dotnet build agent/App -c Release: 0 warnings.
  • No check of its own: the agent's git refuses the local file transport a test origin would need. Tommy's next job shows it: its log says "lacks a commit of main after fetching it: removing it and cloning again", and the error, if any, has git's words.
## Why Tommy's Windows PC (nightly-124) refused the re-planned Longshot #910 with "the pull request's head is no longer e4609af92ac9", but e4609af92ac9 *is* #910's head on the forge. The fetch went through and the clone still lacked the commit. Earlier it lacked main's commit too ("main has no commit 02608169e638", after a git checkout killed with 0xC000013A), so the clone is damaged. #59 clones again only when main's commit is missing. The PR's head was checked first, and its absence was taken as the PR having moved, so the re-clone never ran. ## What changed `JobPipeline`, for a PR job: - After the fetches, if main's commit is still missing, or the PR's is (when the head just fetched is that commit), the clone is damaged. It's removed and cloned again once, and both are fetched again. - A PR whose head really moved is still refused, and the message now says what the head is now. - A commit missing even in a new clone is an infra error that quotes `git cat-file`'s words. ## Testing - Agent checks: 1875 passed. `dotnet build agent/App -c Release`: 0 warnings. - No check of its own: the agent's git refuses the local file transport a test origin would need. Tommy's next job shows it: its log says "lacks a commit of main after fetching it: removing it and cloning again", and the error, if any, has git's words.
fix(agent): a clone that lacks a fetched commit is cloned again before the job is refused
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 3s
CI / Workflow lint (actionlint) (pull_request) Successful in 4s
06eea4b6b6
Tommy's PC refused Longshot #910 with "the pull request's head is no
longer e4609af92ac9" although that is the PR's head: the fetch went through
and the clone still lacked it. #59 cloned again only for a missing main
commit, and the PR's head was checked first. Now either one missing after
its fetch (the PR's when its fetched head is that commit) clones again
once and fetches again; a head that moved is still refused, and says what
it is now, and a commit missing even in a new clone quotes git.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/reclone-pr-head 2026-11-16 12:23:51 +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!66
No description provided.