hermes - 💡(How to fix) Fix Dashboard Chat shows '[session ended]' - TUI entry.js exits in PTY/headless environment [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#24910Fetched 2026-05-14 03:50:42
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

When running Dashboard in PTY/headless mode and connecting the Chat tab, the UI shows [session ended] immediately. The TUI entry.js process exits right after startup, closing the WebSocket.

Root Cause

Root Cause (triple fault)

Fix Action

Fix / Workaround

  1. Modified entry.js — Replaced tty.isatty(1) check with process.stdin.isTTY which is more reliable across pty implementations
  2. Cleared `pycache` — Ensured all Python patches to tui_gateway are actually loaded
  3. Added PTY-environment hardening — entry.js now handles graceful degradation when stdout is not a TTY

Code Example

// ui-tui/src/entry.tsx (approximate)
if (!tty.isatty(process.stdout.fd)) {
  process.exit(0);
}
RAW_BUFFERClick to expand / collapse

Summary

When running Dashboard in PTY/headless mode and connecting the Chat tab, the UI shows [session ended] immediately. The TUI entry.js process exits right after startup, closing the WebSocket.

Root Cause (triple fault)

1. TUI entry.js uses tty.isatty(1) to decide whether to start — fails in PTY mode

// ui-tui/src/entry.tsx (approximate)
if (!tty.isatty(process.stdout.fd)) {
  process.exit(0);
}

When the gateway spawns entry.js via PTY (enabled by default for terminal subprocesses), isatty(1) returns false in certain pty implementations, causing entry.js to exit immediately.

2. Build-stamp cache not checked — git pull triggers unnecessary rebuild

After git pull updates ui-tui/ source files, _tui_build_needed() (in tui_gateway) checks file mtime but does NOT check .build-stamp (a file containing the git commit hash of the last successful build). A worktree switch or git pull that changes mtime but not content triggers a full npm run build.

3. npm run build fails silently in headless environment

When npm run build runs inside a headless / non-interactive session (common in CI, remote dev, or tmux), it may fail due to missing terminal capabilities. The build failure is not surfaced to the user — entry.js is left in a broken state.

Fix Applied

  1. Modified entry.js — Replaced tty.isatty(1) check with process.stdin.isTTY which is more reliable across pty implementations
  2. Cleared `pycache` — Ensured all Python patches to tui_gateway are actually loaded
  3. Added PTY-environment hardening — entry.js now handles graceful degradation when stdout is not a TTY

Steps to Reproduce

  1. git pull updates to a version with changes under ui-tui/
  2. Run Dashboard via PTY-enabled terminal (e.g. hermes dashboard --tui in tmux)
  3. Open Chat tab — shows [session ended]

Environment

  • macOS 13.7.8
  • Hermes Desktop v0.3.6 (Electron, port 8642)
  • Node.js (for TUI build)

Verification

After applying the fix:

  • npm run build succeeds (117 files, 5291ms)
  • Dashboard Chat tab connects successfully
  • WebSocket stays alive

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Dashboard Chat shows '[session ended]' - TUI entry.js exits in PTY/headless environment [1 comments, 2 participants]