Skip to content

fix(tui): rebuild runtime assets during update#32227

Open
hl-luka wants to merge 2 commits into
NousResearch:mainfrom
hl-luka:fix/tui-update-build
Open

fix(tui): rebuild runtime assets during update#32227
hl-luka wants to merge 2 commits into
NousResearch:mainfrom
hl-luka:fix/tui-update-build

Conversation

@hl-luka

@hl-luka hl-luka commented May 25, 2026

Copy link
Copy Markdown

Summary

  • rebuild @hermes/ink and the top-level TUI bundle during hermes update after ui-tui dependencies refresh
  • surface build output and manual recovery guidance if either TUI build step fails
  • refresh ui-tui/package-lock.json so npm ci succeeds instead of falling back to lockfile-mutating npm install
  • extend the update command regression test to cover the new TUI build steps

Why

A git/ZIP update can refresh the TUI source tree while leaving local runtime artifacts missing or stale. In particular, @hermes/ink exposes index.js -> dist/entry-exports.js, but that dist/ file is an untracked build artifact. The documented local recovery is:

cd ui-tui
npm run build --prefix packages/hermes-ink
npm run build

The updater should perform those steps itself after refreshing ui-tui dependencies, rather than reporting a successful update while the TUI may still be broken.

The lockfile part is also reproducible on current main: npm ci --dry-run fails because the committed lockfile is out of sync with ui-tui/packages/hermes-ink/package.json. That causes the updater's deterministic install path to fall back to npm install, which rewrites ui-tui/package-lock.json and leaves the checkout dirty for the next update.

Related:

Verification

  • python -m pytest tests/hermes_cli/test_cmd_update.py tests/hermes_cli/test_tui_resume_flow.py::test_make_tui_argv_dev_prebuilds_hermes_ink -q -o 'addopts='
  • python -m ruff check hermes_cli/main.py tests/hermes_cli/test_cmd_update.py
  • git diff --check
  • cd ui-tui && npm ci --dry-run --no-fund --no-audit --progress=false
  • cd ui-tui && npm ci --no-fund --no-audit --progress=false
  • cd ui-tui && npm run build --prefix packages/hermes-ink && npm run build

@hl-luka hl-luka requested a review from a team May 25, 2026 20:10
@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 comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 25, 2026

@austinpickett austinpickett left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved (pending CI run)

Real P2 bug: After hermes update, TUI assets were never rebuilt — npm ci updated JS dependencies but npm run build was never called, leaving the running TUI with stale bundles.

-592 deletions are lockfile normalization (not dead code removal): The ui-tui/package-lock.json was using "link": true (workspace symlink) for @hermes/ink, with npm having inlined transitive deps as top-level nodes. The new lockfile correctly scopes them under node_modules/@hermes/ink/node_modules/. This makes npm ci (deterministic installs) actually work instead of failing.

Fix: Two new helpers _run_tui_build_step() / _build_tui_runtime_assets() in hermes_cli/main.py; wired into _update_node_dependencies(). Clean, no shell interpolation, no security concerns. Test extension asserts build steps called in correct order.

One blocker: No CI has run on this branch — please rebase on main to trigger checks.

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 comp/tui Terminal UI (ui-tui/ + tui_gateway/) 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.

3 participants