Repository navigation
fix(sandbox): give workspace mounts a 100 GB write quota - #151
chriswritescode-dev wants to merge 1 commit into
Conversation
| args.push( | ||
| '-v', | ||
| ws.readOnly | ||
| ? `${ws.hostDir}:${ws.containerDir}:ro` | ||
| : `${ws.hostDir}:${ws.containerDir}:quota=${SANDBOX_WORKSPACE_QUOTA}`, | ||
| ) |
There was a problem hiding this comment.
Unverified msb syntax
Every writable mount now gets :quota=100g. If the installed msb does not support this option, or a supported msb version does not, msb create fails and all sandboxed sessions and loops stop working. The diff adds no minimum-version check and no fallback. The tests only compare argument strings, so they cannot catch this. Uncertain: I could not confirm from the diff alone which msb versions accept quota= on -v mounts or whether 100g is a valid unit there.
| '[Sandbox] This session runs inside a container: bash tool commands execute in that container, not on the host. OS-specific commands or tools may differ from the host system.', | ||
| 'Environment-specific tooling that is missing or incompatible is not acceptable: install or reinstall the required tooling and dependencies in the container, rerun the intended checks, and do not misreport environment-induced failures as code defects.', | ||
| SHARED_WORKSPACE_ARTIFACTS_NOTE, | ||
| `The project directory mount has a guest-write quota of ${SANDBOX_WORKSPACE_QUOTA}, so df on it reports that budget rather than the host disk's free space; if writes there fail with "No space left on device", delete build output in the workspace rather than concluding the host disk is full.`, |
There was a problem hiding this comment.
Misleading note
The note always states a 100g quota. Sandboxes created before this change keep their 4 GiB mounts, as the PR's own docs admit. In those sandboxes the agent is told something that does not match what df shows, and it is only advised to delete build output, never to recreate the sandbox.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
Summary
msb gives every bind mount a 4 GiB guest-write quota, and inside the sandbox
dfreports that budget as if it were the whole disk. A large Rust build in the shared project directory exhausts it, writes fail with ENOSPC, and agents report the host disk as full while it has hundreds of GiB free.Forge now passes
quota=100gon writable workspace mounts:SANDBOX_WORKSPACE_QUOTAinsrc/sandbox/msb.ts, applied bybuildMsbCreateArgs; read-only mounts keep the plain:rosuffix.SANDBOX_CONTEXT_NOTEstates thatdfon the project mount reports the quota rather than host free space, and that ENOSPC there means deleting build output.docs/sandbox.mddocuments the quota and how to apply it to existing sandboxes.Known limit
msb cannot change a mount on an existing sandbox, so sandboxes created by an earlier Forge build keep their 4 GiB quota until recreated with
msb rm <sandbox>, which also removes their Docker and cache disks.Verification
pnpm test --project node test/sandbox: 543 passedpnpm typecheck,pnpm lintcleanpnpm docs:apiregenerateddocs/api/_media/sandbox.mdPR Type
Enhancement, Bug fix
Description
Add
SANDBOX_WORKSPACE_QUOTA(100g) insrc/sandbox/msb.tsApply
quota=100gto every writable workspace mount:rosuffix on read-only mountsExplain quota,
df, andENOSPCin agent context noteDocument quota behavior and recreation limit; update tests
Diagram Walkthrough
File Walkthrough
1 files
Add workspace quota constant and emit quota mount suffix3 files
Explain workspace quota and ENOSPC in sandbox noteDocument 100 GB quota and existing sandbox limitationRegenerated copy of sandbox quota documentation3 files
Test quota wording in sandbox context noteExpect quota suffix after host path canonicalizationUpdate create-args expectations for quota mount suffix