fix(agent): the game files are copied into the agent's folder when the Windows sandbox can't be let read them #170

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:fix/game-copy into main 2026-11-29 19:27:48 +00:00
Owner

What

On Windows, when this account can't change the permissions of the player's game files, the agent copies them once into <data>\builder\game-copy\ and every build reads the copy.

Why

The farm's Windows testers failed with SetNamedSecurityInfoW (<game files>: the agent must own the folder, or be let change its permissions): error 5, and since #169 with game_not_found. The coordinator's database shows this is one tester, agent-65553b: 77 failed tries in 36 hours (nightly-289), more than any other error. The sandbox is let read the game by a permission on the files, and only an owner (or someone let change permissions) can give one: a file another account owns, a drive without permissions, a network share.

How

PrepareBuilderGameAsync (run first in every job) checks, on Windows only, that the game files' own permissions can be written back (the same call WinAcl.Apply makes). If not, GameCopyAsync copies the .nup (or the dump's folder) to game-copy/, kept while it has the same size and time, and GameSource() names the copy, so every command that reads the game files is given it. The agent owns the copy, so the grant works. An earlier copy of another file is removed.

Not run locally

Not built or run on this PC (no local Beanstalk runs): CI's "Agent build and checks" compiles it and runs BuilderChecks, which now covers the copy helper. The Windows-only probe has no test on Linux CI; the next farm run on agent-65553b is the check.

🤖 Generated with Claude Code

## What On Windows, when this account can't change the permissions of the player's game files, the agent copies them once into `<data>\builder\game-copy\` and every build reads the copy. ## Why The farm's Windows testers failed with `SetNamedSecurityInfoW (<game files>: the agent must own the folder, or be let change its permissions): error 5`, and since #169 with `game_not_found`. The coordinator's database shows this is one tester, `agent-65553b`: 77 failed tries in 36 hours (nightly-289), more than any other error. The sandbox is let read the game by a permission on the files, and only an owner (or someone let change permissions) can give one: a file another account owns, a drive without permissions, a network share. ## How `PrepareBuilderGameAsync` (run first in every job) checks, on Windows only, that the game files' own permissions can be written back (the same call `WinAcl.Apply` makes). If not, `GameCopyAsync` copies the .nup (or the dump's folder) to `game-copy/`, kept while it has the same size and time, and `GameSource()` names the copy, so every command that reads the game files is given it. The agent owns the copy, so the grant works. An earlier copy of another file is removed. ## Not run locally Not built or run on this PC (no local Beanstalk runs): CI's "Agent build and checks" compiles it and runs `BuilderChecks`, which now covers the copy helper. The Windows-only probe has no test on Linux CI; the next farm run on `agent-65553b` is the check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(agent): the game files are copied into the agent's folder when the Windows sandbox can't be let read them
Some checks failed
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
CI / Conventional Commit title (pull_request) Successful in 10s
CI / Coordinator tests (pull_request) Failing after 1m40s
CI / Agent build and checks (pull_request) Successful in 2m23s
CI / Coordinator image (pull_request) Successful in 17s
a19c11e733
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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!170
No description provided.