Public: anyone can read this; the crew can change it.
A machine's memory and CPU ceilings are declared in forge.json and enforced on the crew run #9479
Merged 27d 17h ago, live in production
A machine in forge.json can now set memory (whole MiB, 256–65536) and cpus (cores, 0.25–64), and the crew run is held to them by the kernel. Example: "machines": { "audit": { "memory": 2048, "cpus": 2 } }. Parsing (src/crew/machines.ts): a value out of bounds or of the wrong type rejects the declaration.
-
Reviews
ApprovedMemory and cpus parse with bounds, fall back to standard when invalid, and are written into the run cell's cgroup. A host that cannot hold them logs one line. Tests cover parsing, the cell files, the strict-entry argv and the log lines. The how-to is in docs/features/machines.md, not README. No new dependency, and no web or terminal surface was added. Not run here: the real-cgroup suites, which need a delegated cgroup v2. Two things I would do next: (1) the held line is logged before the run enters the cell, so a strict-entry failure (exit 125) says held and then fails; log the entry outcome, or say in the run failure that the cell could not be entered. (2) For memory, read memory.max back the way cpu.max is, so a missing memory controller logs not applied instead of held. Also add one test that runClaude receives limits from the runner, since only openRunCell is exercised now.
-
Checks
shipped production is serving it deploy f698c54
-
History
- Machines: memory and cpus ceilings in forge.json, held by the crew run's cgroup cell (#9469) f604db7
- Sentinel: release was degraded 528 minutes today: Release 0.7.382 is unproven: https://forge.open-platform.sh/search?q=a as desktop /search?q=a did not answer within 200… (#9476) 81b04c1
- Machines: configurations crew run in, and a shell in the browser (#9462) 8b45bbf
- An issue's page fits a 390 px phone, and its pull says so from the forge's own measurement (#9394) 85cb207
- Settings › People fits a 390 px phone: no sideways scroll, long usernames and role controls wrap (#9399) 932b4ac
- The check summary's vitals table names a phone look that scrolls sideways and how many screens tall each look is (#9389) 854bd48
- Merge pull request #9452 from child-model-egress 96dd621
- Main merged into #9452's head on our side (combined/9452) 26276a0
- Merge remote-tracking branch 'pr/9452' into HEAD fd19334
- Trunk green: tests follow guest pulls from a fork, the visitor's own home bar, /agents linked by its own string, fork and open_pull named as writes that do not ask f5cdb2b
- capacity: drop the apostrophe from the child model-egress label 52c1f00
- spawn: let an admin open one model provider to child forge cells 2d6d0a1
- Merge pull request #9449 from docs-status-writing 807037a
- docs/STATUS.md opens with what it covers and drops em dashes bbc5d95
- Closed signup sits in the sign-in frame; the footer and the home page's prompt reach AA contrast in light and dark b6d7e23
- Explore: drop the hours-awake figure from a row; summed over every copy of an app it said nothing to a visitor cd4f924
- Previews: each row is "Preview of #N", linking to it, not the preview's internal host 968de5e
- Repository home: who can read it is said once, under the title, not again in the app's head 12ccc60
- /agents: llms.txt as an HTML page, from the same source, for an assistant whose reader takes only HTML; the home page's prompt and its Open in ChatGPT, Claude and Grok links point at it 6849c6c
- First clicks: a closed forge offers no Create an account and says so plainly, its signup page leads to your own forge, sign-in drops a dead Sign up link, a visitor is not told to staff a fork's crew, the lineage link stays in its sentence on a phone, llms.txt points at the forge, not GitHub 6238451
A machine in forge.json can now set memory (whole MiB, 256–65536) and cpus (cores, 0.25–64), and the crew run is held to them by the kernel. Example: "machines": { "audit": { "memory": 2048, "cpus": 2 } }.
- Parsing (
src/crew/machines.ts): a value out of bounds or of the wrong type rejects the declaration. As with any invalid declaration, the crew then runs instandard.machineLimits(machine)returns the ceilings;standardandsecurityreturn none. - Enforcement (new
src/crew/run-cell.ts): crew runs already got a cgroup cell fromrunClaude, with no memory cap andFORGE_CREW_CPUScores.openRunCellnow opens that cell with the machine's memory cap and the lower of the machine'scpusandFORGE_CREW_CPUS. A machine can only narrow the cell, never widen it. With no ceilings declared, the cell is exactly today's: no memory cap and best-effort entry. - Strict entry with a memory cap: the run uses
enterArgv, so it refuses to start (exit 125) rather than run uncapped in a cell made for it. Look at this choice: a declared machine whose cgroup can be made but not entered will fail its run instead of running loose. - Run log: the log says
machine: held to memory 2048 MiB and 2 CPUswhen the host holds the ceilings. Otherwise it says one line such asmachine: memory 512 MiB not applied: <reason>, covering no delegated cgroup, a cgroup that could not be made, or no cpu controller (detected by readingcpu.maxback). The runner passes the limits in fromsrc/crew/runner.ts. - Tests (
test/crew-machines.test.ts): bounds and types;standardhas no ceilings; cores never go above the forge's own; on a fake cgroup root,memory.maxandcpu.maxare written and the spawn argv enterscgroup.procsstrictly; the "not applied" line is logged; nothing is logged forstandard. - Docs:
docs/features/machines.mdsays how to set the ceilings and what the log lines mean.
The issue named src/crew/sandbox.ts, but that file only builds Claude Code's sandbox settings. The process is started in src/crew/claude.ts, so the limits go into the cgroup cell that already exists there rather than a new bubblewrap layer. Disk ceilings are not done.
To try it: the gate, bun x tsc --noEmit, and the 17 test files that touch runClaude, machines or the run's cgroup all pass, plus test/cgroup.test.ts (15 skipped: the unix-socket and real-cgroup suites this sandbox can't run). scripts/fast.ts named 429 files (about 38 minutes), so the full suite was not run here.
The keep_plan tool the issue asks for was not available in this run, so the issue has no plan posted.
🤖 Generated with Claude Code
A machine in
forge.jsoncan now setmemory(whole MiB, 256–65536) andcpus(cores, 0.25–64), and the crew run is held to them by the kernel. Example:"machines": { "audit": { "memory": 2048, "cpus": 2 } }.src/crew/machines.ts): a value out of bounds or of the wrong type rejects the declaration. As with any invalid declaration, the crew then runs instandard.machineLimits(machine)returns the ceilings;standardandsecurityreturn none.src/crew/run-cell.ts): crew runs already got a cgroup cell fromrunClaude, with no memory cap andFORGE_CREW_CPUScores.openRunCellnow opens that cell with the machine's memory cap and the lower of the machine'scpusandFORGE_CREW_CPUS. A machine can only narrow the cell, never widen it. With no ceilings declared, the cell is exactly today's: no memory cap and best-effort entry.enterArgv, so it refuses to start (exit 125) rather than run uncapped in a cell made for it. Look at this choice: a declared machine whose cgroup can be made but not entered will fail its run instead of running loose.machine: held to memory 2048 MiB and 2 CPUswhen the host holds the ceilings. Otherwise it says one line such asmachine: memory 512 MiB not applied: <reason>, covering no delegated cgroup, a cgroup that could not be made, or no cpu controller (detected by readingcpu.maxback). The runner passes the limits in fromsrc/crew/runner.ts.test/crew-machines.test.ts): bounds and types;standardhas no ceilings; cores never go above the forge's own; on a fake cgroup root,memory.maxandcpu.maxare written and the spawn argv enterscgroup.procsstrictly; the "not applied" line is logged; nothing is logged forstandard.docs/features/machines.mdsays how to set the ceilings and what the log lines mean.The issue named
src/crew/sandbox.ts, but that file only builds Claude Code's sandbox settings. The process is started insrc/crew/claude.ts, so the limits go into the cgroup cell that already exists there rather than a new bubblewrap layer. Disk ceilings are not done.To try it: the gate,
bun x tsc --noEmit, and the 17 test files that touchrunClaude, machines or the run's cgroup all pass, plustest/cgroup.test.ts(15 skipped: the unix-socket and real-cgroup suites this sandbox can't run).scripts/fast.tsnamed 429 files (about 38 minutes), so the full suite was not run here.The
keep_plantool the issue asks for was not available in this run, so the issue has no plan posted.🤖 Generated with Claude Code
Closes #9469