feat(dashboard): add chat interface via API server proxy#9903
Open
SHL0MS wants to merge 1 commit into
Open
Conversation
Adds a Chat tab to the dashboard that proxies to the gateway's existing API server (/v1/chat/completions) with SSE streaming. Backend (web_server.py): - POST /api/chat/send — proxies to API server with streaming, falls back to non-streaming request when stream returns empty content (surfaces agent errors instead of hanging) - GET /api/chat/status — health check for API server availability Frontend (ChatPage.tsx): - SSE stream parsing (OpenAI-compatible chunks) - Markdown rendering for assistant responses - Session continuity via X-Hermes-Session-Id header - Auto-scroll, auto-resize textarea, Enter to send - Unavailable state with setup instructions when gateway not running Requires the gateway running with api_server platform enabled. i18n: en + zh translations for chat UI strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Chat tab to the dashboard. Proxies to the gateway's existing API server (
/v1/chat/completions) — no new agent lifecycle code, no new dependencies.Backend — 2 endpoints, 110 lines
POST /api/chat/send— SSE streaming proxy tolocalhost:8642/v1/chat/completionsX-Hermes-Session-Idfor session continuityAPI_SERVER_KEYto the API server when setfinish_reasonwithout content, falls back to a non-streaming request to surface the actual error messageAPI_SERVER_PORTenv varGET /api/chat/status— health check, hits the API server's/healthendpointBoth are protected by the existing auth middleware (#9800).
Frontend — ChatPage.tsx, 212 lines
choices[0].delta.contentchunks)Markdowncomponenthermes gateway startinstructionRequires
The gateway must be running with the
api_serverplatform enabled:Then
hermes gateway start. The Chat tab detects this automatically and shows setup instructions if not configured.Files changed
hermes_cli/web_server.pyweb/src/pages/ChatPage.tsxweb/src/App.tsxweb/src/lib/api.tscheckChatStatus()methodweb/src/i18n/types.tsweb/src/i18n/en.tsweb/src/i18n/zh.ts