Skip to content

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

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

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.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the careful reproduction and the dependency/build coverage. This is an automated hermes-sweeper review; current main already provides the requested runtime guarantee through a newer design.

  • hermes_cli/main.py:1786-1902 rebuilds the normal TUI bundle with npm run build before launching ui-tui/dist/entry.js; tests/hermes_cli/test_tui_npm_install.py:278-299 covers that always-build path.
  • c6ca11618a87c6b12e9a4025d339eb905a03ac8c introduced the simplified always-rebuild TUI launch behavior and is an ancestor of current main.
  • a51a7b9b92b63b5f97afa0fc31c9cd349f04b5ec consolidated the project into a root workspace lockfile, removed ui-tui/package-lock.json, and updated the updater to install the ui-tui workspace (hermes_cli/main.py:8139-8183).
  • The current repository enforces the consolidated-lockfile invariant in tests/hermes_cli/test_tui_npm_install.py:465-499.

The PR's useful failure analysis matched the former per-ui-tui lockfile/update path, but its implementation is now redundant and its lockfile target no longer exists on main.

@teknium1 teknium1 closed this Jul 13, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 13, 2026
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 sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants