hermes - 💡(How to fix) Fix Dashboard --tui chat tab unusable in v0.12.0 (tui_gateway crashes during handshake)

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…

In Hermes Agent v0.12.0, the dashboard chat tab is unusable because the tui_gateway sidecar process hangs on a synchronous WebSocket handshake at startup, then is SIGTERM'd / SIGHUP'd by the parent dashboard before it can publish any events. The browser's /chat view shows an empty canvas (sometimes [session ended]) and never accepts input.

CLI chat (hermes chat …) and one-shot mode (hermes -z …) work normally with the same provider/model, so this is a TUI-gateway-only regression.

Error Message

=== SIGHUP received · 2026-05-07 18:24:09 === main-thread stack at signal delivery: File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module> main() File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 172, in main _install_sidecar_publisher() File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 39, in _install_sidecar_publisher server._stdio_transport, WsPublisherTransport(url) File "/usr/local/lib/hermes-agent/tui_gateway/event_publisher.py", line 57, in init self._ws = ws_connect(url, open_timeout=connect_timeout, max_size=None) File ".../websockets/sync/client.py", line 378, in connect connection.handshake( File ".../websockets/sync/client.py", line 93, in handshake if not self.response_rcvd.wait(timeout):

=== unhandled exception · 2026-05-07 18:24:10 === Traceback (most recent call last): File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module> main() File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 208, in main _log_exit("startup write failed (broken stdout pipe before first event)") File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 168, in _log_exit print(f"[gateway-exit] {reason}", file=sys.stderr, flush=True) BrokenPipeError: [Errno 32] Broken pipe

Root Cause

In Hermes Agent v0.12.0, the dashboard chat tab is unusable because the tui_gateway sidecar process hangs on a synchronous WebSocket handshake at startup, then is SIGTERM'd / SIGHUP'd by the parent dashboard before it can publish any events. The browser's /chat view shows an empty canvas (sometimes [session ended]) and never accepts input.

Fix Action

Workaround

Use hermes chat … directly in a terminal — works fine. The dashboard remains usable for sessions / models / config / skills / cron browsing, just not chat.

Code Example

=== gateway exit · 2026-05-07 18:24:10 · reason=startup write failed (broken stdout pipe before first event) ===

---

=== SIGHUP received · 2026-05-07 18:24:09 ===
main-thread stack at signal delivery:
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module>
    main()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 172, in main
    _install_sidecar_publisher()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 39, in _install_sidecar_publisher
    server._stdio_transport, WsPublisherTransport(url)
  File "/usr/local/lib/hermes-agent/tui_gateway/event_publisher.py", line 57, in __init__
    self._ws = ws_connect(url, open_timeout=connect_timeout, max_size=None)
  File ".../websockets/sync/client.py", line 378, in connect
    connection.handshake(
  File ".../websockets/sync/client.py", line 93, in handshake
    if not self.response_rcvd.wait(timeout):

=== unhandled exception · 2026-05-07 18:24:10 ===
Traceback (most recent call last):
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module>
    main()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 208, in main
    _log_exit("startup write failed (broken stdout pipe before first event)")
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 168, in _log_exit
    print(f"[gateway-exit] {reason}", file=sys.stderr, flush=True)
BrokenPipeError: [Errno 32] Broken pipe
RAW_BUFFERClick to expand / collapse

Summary

In Hermes Agent v0.12.0, the dashboard chat tab is unusable because the tui_gateway sidecar process hangs on a synchronous WebSocket handshake at startup, then is SIGTERM'd / SIGHUP'd by the parent dashboard before it can publish any events. The browser's /chat view shows an empty canvas (sometimes [session ended]) and never accepts input.

CLI chat (hermes chat …) and one-shot mode (hermes -z …) work normally with the same provider/model, so this is a TUI-gateway-only regression.

Steps to reproduce

  1. Fresh install on WSL2 / Ubuntu 24.04 via curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash.
  2. hermes auth add --type oauth openai-codex (succeeds).
  3. hermes dashboard --tui (auto-open fails with gio: Operation not supported on WSL — minor; manually open http://127.0.0.1:9119/chat).
  4. Click into the chat canvas, try typing — input is not echoed and no response ever arrives.

Expected

Browser /chat tab attaches to a live tui_gateway and behaves like the embedded hermes --tui.

Actual

~/.hermes/logs/tui_gateway_crash.log shows the gateway is signalled while blocked inside WsPublisherTransport.__init__websockets.sync.client.connecthandshake()response_rcvd.wait(timeout). After SIGHUP, _log_exit itself raises BrokenPipeError because the parent's stdout pipe is already closed.

Relevant exit line:

=== gateway exit · 2026-05-07 18:24:10 · reason=startup write failed (broken stdout pipe before first event) ===

Crash trace (truncated — both SIGTERM and SIGHUP captures look identical):

=== SIGHUP received · 2026-05-07 18:24:09 ===
main-thread stack at signal delivery:
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module>
    main()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 172, in main
    _install_sidecar_publisher()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 39, in _install_sidecar_publisher
    server._stdio_transport, WsPublisherTransport(url)
  File "/usr/local/lib/hermes-agent/tui_gateway/event_publisher.py", line 57, in __init__
    self._ws = ws_connect(url, open_timeout=connect_timeout, max_size=None)
  File ".../websockets/sync/client.py", line 378, in connect
    connection.handshake(
  File ".../websockets/sync/client.py", line 93, in handshake
    if not self.response_rcvd.wait(timeout):

=== unhandled exception · 2026-05-07 18:24:10 ===
Traceback (most recent call last):
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 235, in <module>
    main()
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 208, in main
    _log_exit("startup write failed (broken stdout pipe before first event)")
  File "/usr/local/lib/hermes-agent/tui_gateway/entry.py", line 168, in _log_exit
    print(f"[gateway-exit] {reason}", file=sys.stderr, flush=True)
BrokenPipeError: [Errno 32] Broken pipe

errors.log from the same window also contains a TUI renderer OSError: [Errno 5] Input/output error from prompt_toolkit/output/vt100.py's flush_stdout, consistent with the gateway being torn down mid-startup.

Likely cause

_install_sidecar_publisher() calls WsPublisherTransport(url) synchronously, which blocks until the WS handshake completes. If the parent dashboard hasn't fully bound the gateway endpoint by then (or the URL/auth is wrong), the gateway sits in handshake() until the parent gives up and signals it — at which point its stdout pipe is already gone, so the exit-logging itself crashes.

Suggestions:

  1. Make the sidecar publisher install asynchronous (or retry the handshake with backoff) so a brief startup race doesn't kill the gateway.
  2. Wrap the _log_exit print(..., file=sys.stderr) in try/except BrokenPipeError so the gateway exits cleanly even when the parent is gone.
  3. Surface the gateway's exit reason in the dashboard /chat UI (right now the user just sees a blank canvas — there's no indication the backend died).

Workaround

Use hermes chat … directly in a terminal — works fine. The dashboard remains usable for sessions / models / config / skills / cron browsing, just not chat.

Environment

  • Hermes Agent: v0.12.0 (2026.4.30), Up to date
  • Provider/Model: openai-codex / gpt-5.3-codex (also reproduced with gpt-5.5)
  • OpenAI SDK: 2.33.0
  • Platform: WSL2 on Windows 10 Home 19045 → Ubuntu 24.04.4 LTS, x86_64
  • Python: 3.11.15 (uv-managed in venv) / system 3.12.3
  • Node: v22.22.2
  • Install method: official install.sh, root install path (/usr/local/lib/hermes-agent)

Happy to attach the full tui_gateway_crash.log and errors.log if useful.

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