Skip to content

fix(test): tier local vitest worker defaults by host memory#24719

Merged
ngutman merged 2 commits intomainfrom
fix/vitest-memory-tiered-defaults
Feb 23, 2026
Merged

fix(test): tier local vitest worker defaults by host memory#24719
ngutman merged 2 commits intomainfrom
fix/vitest-memory-tiered-defaults

Conversation

@ngutman
Copy link
Contributor

@ngutman ngutman commented Feb 23, 2026

Summary

  • make local pnpm test worker defaults memory-tiered by host RAM in scripts/test-parallel.mjs
  • keep aggressive parallel defaults for high-memory local hosts (>=96 GiB)
  • default sub-64 GiB hosts to conservative low-style workers and serial gateway to avoid OOM
  • add a concise AGENTS note with a safe local gate command when Vitest memory pressure is observed

Why

Recent parallel worker tuning made local Vitest runs on lower-memory machines hit extreme RSS and destabilize the host during land/gate workflows.

Validation

  • pnpm check
  • pnpm build
  • monitored pnpm test on this machine after patch: completed with peak RSS ~10.06 GiB (previously default profile was peaking around ~18.3 GiB and being terminated for safety)

Greptile Summary

Tiered local Vitest worker defaults by host memory to prevent OOM on lower-memory machines during pnpm test runs.

  • Introduced memory-based host classification (high >=96 GiB, low <64 GiB, mid 64-95 GiB)
  • High-memory hosts (Mac Studio class) maintain aggressive parallel defaults for fast wall-clock times
  • Low-memory hosts (<64 GiB) default to conservative workers (unit=2, unitIsolated=1, extensions=1, gateway=1) to avoid OOM
  • Mid-range hosts (64-95 GiB) get moderate parallelism with conservative gateway settings
  • Gateway parallel mode now enabled automatically on high-memory local hosts
  • Added AGENTS.md note documenting the manual override command for users experiencing memory pressure

Confidence Score: 5/5

  • Safe to merge - addresses a validated operational issue with a well-structured solution
  • The changes are defensive, well-tested by the author (validated RSS reduction from ~18.3 GiB to ~10.06 GiB), and preserve existing behavior for high-memory hosts while fixing OOM issues on lower-memory machines. The logic is clear with reasonable thresholds, and the documentation update provides a manual escape hatch for users.
  • No files require special attention

Last reviewed commit: 27a8cbd

@openclaw-barnacle openclaw-barnacle bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Feb 23, 2026
@khalaf-01290
Copy link

fix/vitest-memory-tiered-defaults

@ngutman ngutman force-pushed the fix/vitest-memory-tiered-defaults branch from 27a8cbd to 5cc05e4 Compare February 23, 2026 19:19
@ngutman ngutman merged commit 8b3eee7 into main Feb 23, 2026
1 check passed
@ngutman ngutman deleted the fix/vitest-memory-tiered-defaults branch February 23, 2026 19:19
@ngutman
Copy link
Contributor Author

ngutman commented Feb 23, 2026

Landed via temp rebase onto main.

  • Gate: pnpm check && pnpm build && pnpm test (test suite currently fails upstream in extensions; check/build passed)
  • Land commit: 5cc05e4
  • Merge commit: 8b3eee7

Thanks @ngutman!

@martinfrancois
Copy link
Contributor

Thanks for this @ngutman, my little server was close to dying from the load of the tests!

mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
… (thanks @ngutman)

(cherry picked from commit 8b3eee7)

# Conflicts:
#	CHANGELOG.md
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
… (thanks @ngutman)

(cherry picked from commit 8b3eee7)

# Conflicts:
#	CHANGELOG.md
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants