From 0d7b36e2acc54efb138759c75ef066f3305297d4 Mon Sep 17 00:00:00 2001 From: fiik f Date: Fri, 8 May 2026 02:03:33 +0000 Subject: [PATCH] fix(tui): update _hermes_ink_bundle_stale to check for entry-exports.js Commit 2d3d1d973 changed the hermes-ink build script from --outfile=dist/ink-bundle.js to --outdir=dist (producing dist/entry-exports.js), but _hermes_ink_bundle_stale was never updated to match. This caused _tui_build_needed to always return True, triggering a 20+ second npm run build on every /api/pty WebSocket connection, which blocked the asyncio event loop and caused the WebSocket handshake to time out (HTTP 502 via nginx). Fixes: the dashboard 'Chat' tab being permanently broken after any restart. See: commit 2d3d1d973 ("fix(tui): use --outdir instead of --outfile") See: PR #15351 which originally added the stale check --- hermes_cli/main.py | 2 +- tests/hermes_cli/test_tui_npm_install.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 70d15d4c0f2f..02951ed77b26 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -972,7 +972,7 @@ def _tui_build_needed(tui_dir: Path) -> bool: def _hermes_ink_bundle_stale(tui_dir: Path) -> bool: ink_root = tui_dir / "packages" / "hermes-ink" - bundle = ink_root / "dist" / "ink-bundle.js" + bundle = ink_root / "dist" / "entry-exports.js" if not bundle.exists(): return True bm = bundle.stat().st_mtime diff --git a/tests/hermes_cli/test_tui_npm_install.py b/tests/hermes_cli/test_tui_npm_install.py index 1dec6257165f..1104b19ee9b9 100644 --- a/tests/hermes_cli/test_tui_npm_install.py +++ b/tests/hermes_cli/test_tui_npm_install.py @@ -26,7 +26,7 @@ def _touch_tui_entry(root: Path) -> None: def _touch_ink_bundle(root: Path) -> None: - bundle = root / "packages" / "hermes-ink" / "dist" / "ink-bundle.js" + bundle = root / "packages" / "hermes-ink" / "dist" / "entry-exports.js" bundle.parent.mkdir(parents=True, exist_ok=True) bundle.write_text("export {}")