Skip to content

fix(cli): check hermes_cli/web_dist/ not web/dist/ for build staleness (fixes #14914 regression)#15863

Closed
georgeglessner wants to merge 1 commit into
NousResearch:mainfrom
georgeglessner:fix/web-ui-dist-dir-sentinel
Closed

fix(cli): check hermes_cli/web_dist/ not web/dist/ for build staleness (fixes #14914 regression)#15863
georgeglessner wants to merge 1 commit into
NousResearch:mainfrom
georgeglessner:fix/web-ui-dist-dir-sentinel

Conversation

@georgeglessner

Copy link
Copy Markdown

What does this PR do?

PR #14914 introduced _web_ui_build_needed() to skip the npm install + Vite rebuild when the dist is already fresh. However, it contains a path bug that makes the fix a complete no-op:

# PR #14914 — WRONG
sentinel = web_dir / "dist" / ".vite" / "manifest.json"

web_dir is PROJECT_ROOT/web/. But vite.config.ts sets:

build: { outDir: "../hermes_cli/web_dist" }

So the actual build output lands in hermes_cli/web_dist/, never in web/dist/. The sentinel is always missing → _web_ui_build_needed always returns True → the full npm build runs on every startup → OOM on low-memory VPS is unchanged.

This PR fixes the sentinel path:

# Correct — matches actual Vite outDir
dist_dir = web_dir.parent / "hermes_cli" / "web_dist"
sentinel = dist_dir / ".vite" / "manifest.json"

Related Issues

Fixes #14898
Supersedes / fixes the regression in #14914

Changes

How to Test

pytest tests/hermes_cli/test_web_ui_build.py -v
# 11 passed

End-to-end: run hermes dashboard once to build, then run again — second startup skips npm entirely.

_web_ui_build_needed() in PR NousResearch#14914 checked web_dir/"dist" as the
sentinel, but vite.config.ts sets outDir: "../hermes_cli/web_dist" so
the build output lands in hermes_cli/web_dist/, never in web/dist/.
The sentinel was therefore always missing → _web_ui_build_needed always
returned True → npm install + Vite build ran on every startup → OOM on
low-memory VPS persisted unchanged.

Fix: derive dist_dir as web_dir.parent / "hermes_cli" / "web_dist" so
the sentinel points to the actual build output directory.

Fixes NousResearch#14898
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 26, 2026
@georgeglessner

Copy link
Copy Markdown
Author

merged in #16292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants