Problem
The hermes dashboard command rebuilds the entire web UI (npm install + TypeScript + Vite build) on every startup, causing OOM kills on low-memory VPS instances (≤1GB RAM).
Error Output
Apr 24 03:56:14 glockbot systemd[1]: hermes-dashboard.service: Failed with result 'oom-kill'.
Apr 24 03:56:14 glockbot systemd[1]: hermes-dashboard.service: Consumed 43.891s CPU time, 387.9M memory peak
Environment
- Hermes Agent version: latest main (6fdbf2f)
- OS: Ubuntu 22.04 LTS
- RAM: 960MB (VPS)
- Command:
hermes dashboard --host <ip> --port 80 --no-open --insecure
Reproduction Steps
- Run
hermes dashboard --host 0.0.0.0 --port 80 on a VPS with ≤1GB RAM
- Process builds web UI from scratch (~45s, peaks at 387MB)
- systemd OOM killer terminates the process
Expected Behavior
Dashboard should:
- Use a pre-built
web/dist/ if present (ship static assets in releases)
- Or build once and cache (check timestamps before rebuild)
- Skip npm build entirely when
dist/ exists and is fresh
Proposed Solutions
Option A: Ship pre-built dist/ in PyPI releases
Include web/dist/ in the wheel/sdist so users never need npm/node.
Option B: Lazy build with caching
# pseudocode for dashboard startup
dist_path = Path(__file__).parent / "web" / "dist"
source_mtime = max(f.stat().st_mtime for f in web_src.rglob("*"))
dist_mtime = dist_path.stat().st_mtime if dist_path.exists() else 0
if not dist_path.exists() or source_mtime > dist_mtime:
build_web_ui() # npm run build
# else: serve existing dist/
Option C: Separate build command
hermes dashboard build # one-time build
hermes dashboard serve # just serve existing dist/
Impact
- Breaks dashboard functionality on low-resource servers
- Wastes CPU/memory on every restart (systemd service loops)
- Forces users to disable dashboard entirely
Workarounds Tried
- Added
--insecure flag (fixed security check, not the OOM)
- Disabled systemd auto-start (avoids loop but loses dashboard)
Problem
The
hermes dashboardcommand rebuilds the entire web UI (npm install + TypeScript + Vite build) on every startup, causing OOM kills on low-memory VPS instances (≤1GB RAM).Error Output
Environment
hermes dashboard --host <ip> --port 80 --no-open --insecureReproduction Steps
hermes dashboard --host 0.0.0.0 --port 80on a VPS with ≤1GB RAMExpected Behavior
Dashboard should:
web/dist/if present (ship static assets in releases)dist/exists and is freshProposed Solutions
Option A: Ship pre-built dist/ in PyPI releases
Include
web/dist/in the wheel/sdist so users never need npm/node.Option B: Lazy build with caching
Option C: Separate build command
Impact
Workarounds Tried
--insecureflag (fixed security check, not the OOM)