feat(dashboard): always enable embedded chat; remove dashboard --tui 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.
This commit is contained in:
+1
-5
@@ -24,7 +24,6 @@ hermes dashboard
|
||||
| `--host` | `127.0.0.1` | 绑定地址 |
|
||||
| `--no-open` | — | 不自动打开浏览器 |
|
||||
| `--insecure` | 关闭 | 允许绑定到非 localhost 主机(**危险**——会在网络上暴露 API 密钥;请配合防火墙和强认证使用) |
|
||||
| `--tui` | 关闭 | 启用浏览器内 Chat 标签页(通过 PTY/WebSocket 嵌入 `hermes --tui`)。也可设置 `HERMES_DASHBOARD_TUI=1`。 |
|
||||
|
||||
```bash
|
||||
# 自定义端口
|
||||
@@ -35,9 +34,6 @@ hermes dashboard --host 0.0.0.0
|
||||
|
||||
# 启动时不打开浏览器
|
||||
hermes dashboard --no-open
|
||||
|
||||
# 启用浏览器内 Chat 标签页
|
||||
hermes dashboard --tui
|
||||
```
|
||||
|
||||
## 前置条件
|
||||
@@ -52,7 +48,7 @@ pip install 'hermes-agent[web,pty]'
|
||||
|
||||
在没有依赖项的情况下运行 `hermes dashboard` 时,它会告诉你需要安装什么。如果前端尚未构建且 `npm` 可用,则会在首次启动时自动构建。
|
||||
|
||||
Chat 标签页在普通 `hermes dashboard` 启动时默认关闭。如需嵌入式浏览器聊天面板,请使用 `hermes dashboard --tui` 启动,或设置 `HERMES_DASHBOARD_TUI=1`。
|
||||
Chat 标签页是每次 `hermes dashboard` 启动的一部分——内嵌的浏览器聊天面板(通过 PTY/WebSocket 运行 TUI)始终可用,无需任何额外参数。
|
||||
|
||||
## 页面
|
||||
|
||||
|
||||
Reference in New Issue
Block a user