You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agents): cap CARGO_BUILD_JOBS in agent launch env (#601)
Prepend CARGO_BUILD_JOBS=max(2, floor(cpus/4)) to every agent launch
command so concurrent fleet runs don't oversubscribe the host when
child cargo builds fan out. Harmless on non-Rust agents — cargo is
the only consumer of the env var.
Tests previously hardcoded CARGO_BUILD_JOBS=8 (passed only on
32-CPU hosts); they now compute the expected value from os.cpus()
so CI on any CPU count stays green.
Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cap `CARGO_BUILD_JOBS` in the env prefix of every agent launch command so concurrent agent runs don't oversubscribe the host when child cargo builds fan out. Formula: `max(2, floor(os.cpus().length / 4))`. Harmless on non-Rust agents (env var is only read by cargo).
6
+
7
+
## Files
8
+
9
+
-`src/agents/launch.js` — new `buildResourceEnv()`, prepended to `buildSessionEnv()` in `buildAgentLaunchCommand`.
10
+
-`test/agents-launch.test.js` — expected `CARGO_BUILD_JOBS=<n>` is computed from `os.cpus()` (was hardcoded `=8`, only passed on 32-CPU hosts). Added a coverage test asserting the formula.
11
+
-`test/agents-start-dry-run.test.js` — regex relaxed to `CARGO_BUILD_JOBS=\d+`.
12
+
-`test/agents-start.test.js` — canonical-session `launchCommand` assertions updated to use the computed `CARGO` prefix.
0 commit comments