diff --git a/scripts/pr-lib/gates.sh b/scripts/pr-lib/gates.sh index 7988418b7d4..5b85ac984dd 100644 --- a/scripts/pr-lib/gates.sh +++ b/scripts/pr-lib/gates.sh @@ -103,11 +103,16 @@ prepare_gates() { echo "Docs-only change detected with high confidence; skipping pnpm test." else gates_mode="full" - echo "Running pnpm test with OPENCLAW_VITEST_MAX_WORKERS=${OPENCLAW_VITEST_MAX_WORKERS:-4}." - run_quiet_logged \ - "pnpm test" \ - ".local/gates-test.log" \ - env OPENCLAW_VITEST_MAX_WORKERS="${OPENCLAW_VITEST_MAX_WORKERS:-4}" pnpm test + if [ -n "${OPENCLAW_VITEST_MAX_WORKERS:-}" ]; then + echo "Running pnpm test with OPENCLAW_VITEST_MAX_WORKERS=$OPENCLAW_VITEST_MAX_WORKERS." + run_quiet_logged \ + "pnpm test" \ + ".local/gates-test.log" \ + env OPENCLAW_VITEST_MAX_WORKERS="$OPENCLAW_VITEST_MAX_WORKERS" pnpm test + else + echo "Running pnpm test with host-aware scheduling defaults." + run_quiet_logged "pnpm test" ".local/gates-test.log" pnpm test + fi previous_full_gates_head="$current_head" fi fi