mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
tui(opentui): preflight node_modules before spawning the Bun engine
Bun runs the TS entry directly (no build step), so a missing `bun install` otherwise surfaces as a cryptic '@opentui' resolve crash + blank UI. Fail loudly with the fix instead. Part of the gateway build/run hardening.
This commit is contained in:
parent
0240299fb0
commit
cff7b365d2
1 changed files with 12 additions and 0 deletions
|
|
@ -1630,6 +1630,18 @@ def _make_opentui_argv(tui_dev: bool) -> tuple[list[str], Path]:
|
|||
for app_dir, rel in candidates:
|
||||
entry = app_dir / rel
|
||||
if entry.is_file():
|
||||
# Preflight: Bun runs the TS entry directly (no build step), so the
|
||||
# package's node_modules must already be installed or the first
|
||||
# `import '@opentui/...'` dies with a cryptic resolve error and a blank
|
||||
# UI. Fail loudly with the fix instead.
|
||||
if not (app_dir / "node_modules" / "@opentui").is_dir():
|
||||
print(
|
||||
f"OpenTUI engine dependencies are not installed in {app_dir}.\n"
|
||||
f"Run: (cd {app_dir} && bun install)\n"
|
||||
f"Or unset HERMES_TUI_ENGINE to use the default Ink engine.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
bun = _bun_bin()
|
||||
args = [bun]
|
||||
if tui_dev:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue