Skip to content

fix(tui): replace ink-bundle.js with entry-exports.js and auto-resume session on /chat reconnect#20686

Open
yigenhuobah wants to merge 2 commits into
NousResearch:mainfrom
yigenhuobah:fix/tui-stale-check-and-session-resume
Open

fix(tui): replace ink-bundle.js with entry-exports.js and auto-resume session on /chat reconnect#20686
yigenhuobah wants to merge 2 commits into
NousResearch:mainfrom
yigenhuobah:fix/tui-stale-check-and-session-resume

Conversation

@yigenhuobah

Copy link
Copy Markdown

Problem

PR #20322 added staleness detection for the @hermes/ink bundle, but used the
wrong output filename (ink-bundle.js). The esbuild config actually outputs
entry-exports.js, making the stale-check always trigger a rebuild.

Additionally, when a user navigates away from the /chat page in the dashboard
and comes back, the WebSocket PTY connection spawns a new TUI process without
a session resume ID, causing the embedded chat to show "forging session…" and
refuse keyboard input.

Changes

  1. Replace all ink-bundle.js references with entry-exports.js in
       _tui_ink_bundle_exists and _hermes_ink_bundle_stale.

  2. Add "packages" to the os.walk skip set in _tui_build_needed so it
       doesn't redundantly walk into packages/hermes-ink/src/ — staleness
       for that sub-package is already handled by _hermes_ink_bundle_stale.

  3. In _resolve_chat_argv (web server PTY handler), auto-resume the most
       recent TUI session when no explicit resume ID is provided. Uses the
       existing _resolve_last_session(source="tui") helper.

  4. Update tests: rename helpers to use entry-exports.js, add coverage for
       the bundle-present case.

How to test

  • Start hermes dashboard --tui
  • Open /chat, have a conversation
  • Navigate to /sessions (or any other tab)
  • Navigate back to /chat
  • Keyboard input should work immediately, resuming the existing session

OutThisLife and others added 2 commits May 6, 2026 19:12
…ession

- _hermes_ink_bundle_stale: check entry-exports.js instead of ink-bundle.js
- _tui_ink_bundle_exists: check entry-exports.js instead of ink-bundle.js
- _tui_build_needed: skip 'packages' directory to avoid redundant staleness
  walk into packages/hermes-ink/src/
- _resolve_chat_argv: auto-resume most recent TUI session when no resume
  param is passed (fixes broken input after navigating away from /chat)
- tests: update bundle filename references and add coverage
@yigenhuobah yigenhuobah force-pushed the fix/tui-stale-check-and-session-resume branch from 7f43917 to 39d5dc6 Compare May 6, 2026 11:14
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels May 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: superset of #20322 (same ink-bundle.js → entry-exports.js fix, plus adds auto-resume on /chat reconnect).

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