Skip to content

Dashboard rebuilds web UI on every startup - causes OOM on low-memory VPS (≤1GB) #14898

@georgeglessner

Description

@georgeglessner

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

  1. Run hermes dashboard --host 0.0.0.0 --port 80 on a VPS with ≤1GB RAM
  2. Process builds web UI from scratch (~45s, peaks at 387MB)
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions