Skip to content

feat(dashboard): always enable embedded chat; remove dashboard --tui flag - #38604

Closed
teknium1 wants to merge 1 commit into
mainfrom
hermes/hermes-040df651
Closed

feat(dashboard): always enable embedded chat; remove dashboard --tui flag#38604
teknium1 wants to merge 1 commit into
mainfrom
hermes/hermes-040df651

Conversation

@teknium1

@teknium1 teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The dashboard's embedded Chat surface (/chat, /api/ws, /api/pty) is now always available — a plain hermes dashboard no longer slams the chat WebSocket shut with WS close 4403.

Previously the embedded chat was gated behind hermes dashboard --tui / HERMES_DASHBOARD_TUI=1. A dashboard started without the flag passed the /api/status health check but rejected the chat WebSocket, so the desktop app (and the in-browser Chat tab) connected, reported "ready", and chat silently stayed dead — the root cause behind multiple "desktop app won't connect to a self-hosted dashboard" reports, on Docker and host installs alike.

Per discussion with @teknium1, this makes the embedded chat unconditional and removes the --tui dashboard flag entirely.

Changes

  • hermes_cli/web_server.py: _DASHBOARD_EMBEDDED_CHAT_ENABLED defaults to True; dropped the embedded_chat param + runtime reassignment from start_server(). The WS gates still read the constant, keeping the seam and its "rejects when disabled" contract test meaningful.
  • hermes_cli/main.py: removed the --tui dashboard argument and the embedded_chat derivation.
  • web/src/lib/dashboard-flags.ts: isDashboardEmbeddedChatEnabled() returns true; dropped the deprecated __HERMES_DASHBOARD_TUI__ alias.
  • web/vite.config.ts: removed the dead LEGACY_TUI_RE scrape.
  • apps/desktop/electron/main.cjs: dropped --tui + the redundant HERMES_DASHBOARD_TUI env injection from the spawned dashboard.
  • Docs: removed every dashboard --tui / HERMES_DASHBOARD_TUI reference (CLI ref, env-var ref, docker/desktop/web-dashboard guides, in-app tips, zh-Hans). Terminal hermes --tui / HERMES_TUI left untouched (unrelated flag).

Validation

Before After
hermes dashboard chat WS 4403 reject (silent) works
Python tests 239 pass (dashboard lifecycle flags, web_server, docker home override)
web/ tsc --noEmit not run by contributor clean (exit 0)

Salvage of #38591 by @benbarclay, cherry-picked onto current main with authorship preserved. Closes #38591.

Infographic

dashboard-chat-always-on

…flag

The dashboard's embedded Chat surface (/chat, /api/ws, /api/pty) was gated
behind `hermes dashboard --tui` / HERMES_DASHBOARD_TUI=1. The desktop app and
the dashboard's own Chat tab both drive the agent over the /api/ws + /api/pty
WebSockets, so a dashboard started without the flag would pass the /api/status
health check but slam the chat WebSocket shut with WS code 4403 — the app
connects, reports "ready", and chat stays dead. This was the root cause behind
multiple user reports of the desktop app failing to connect to a self-hosted
gateway/dashboard, and it bit Docker and host installs alike.

Make the embedded chat unconditional:

- web_server.py: _DASHBOARD_EMBEDDED_CHAT_ENABLED defaults to True; drop the
  embedded_chat parameter and the runtime reassignment from start_server().
  The WS gates still read the constant (now always true) so the seam — and its
  "rejects when disabled" contract test — stays meaningful.
- main.py: remove the `--tui` argument from the dashboard subparser and the
  `embedded_chat = args.tui or HERMES_DASHBOARD_TUI==1` derivation.
- web/: isDashboardEmbeddedChatEnabled() returns true unconditionally; drop the
  deprecated __HERMES_DASHBOARD_TUI__ alias and the dead LEGACY_TUI_RE scrape in
  the vite dev-token plugin.
- apps/desktop/electron/main.cjs: drop `--tui` from the spawned dashboardArgs
  (it would now error with "unrecognized arguments: --tui") and the redundant
  HERMES_DASHBOARD_TUI env injection.
- Docker: no s6 run-script change needed — the script never passed --tui; the
  HERMES_DASHBOARD_TUI env var is now simply a no-op, so the image works out of
  the box with no extra var.
- Docs: remove every dashboard --tui / HERMES_DASHBOARD_TUI reference across the
  CLI reference, env-var reference, docker/desktop/web-dashboard guides, in-app
  tips, and the zh-Hans translations. The terminal `hermes --tui` / HERMES_TUI
  references are intentionally left untouched.

Tests: 270 passing across web_server, dashboard lifecycle, host-header,
auth-gate, and docker-override-scripts suites.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-040df651 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9779 on HEAD, 9779 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5071 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Looks like a duplicate of #38591 (same title, same change — make dashboard embedded chat unconditional and drop the --tui flag). Both are open; suggest consolidating to one PR.

@teknium1

teknium1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing as redundant — embedded chat is already always-on on main (_DASHBOARD_EMBEDDED_CHAT_ENABLED=True) and the dashboard --tui flag / embedded_chat param are already gone. The PR's diff just looks like new work because its base is stale.

@teknium1 teknium1 closed this Jun 8, 2026
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/) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants