mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-21 07:55:08 +00:00
The messaging gateway logs every inbound message to gateway.log, but its dashboard/TUI twin (gui.log) was nearly silent: the dashboard FastAPI app had host-header/auth-gate/auth middlewares but no access log, and 3 of 4 WebSocket endpoints logged nothing at all. Worst of these, /api/pty logged 'pty accepted' on connect but was completely silent on close — a PTY EOF (backend crash), a send failure, or a client drop left no trace, so user-reported 'chat disconnected / TUI froze' was unreproducible. Extend the convention tui_gateway/ws.py::handle_ws already establishes (a structured 'ws closed peer=... reason=... <counters>' line) across the whole surface, at the same INFO granularity as gateway.log, into the gui.log that is already sized for it (10MB x5): - HTTP access-log middleware (registered LIFO-outermost so it captures the final status, including 400/401 from the middlewares above): one INFO line per request with method, path, status, latency, request id, peer. Path only, never the query string (tokens ride in query on some routes). UA/referer at DEBUG (-v). Reads/echoes X-Request-ID for client/proxy correlation. - /api/pty: structured close line covering all exit paths (client_disconnect | pty_eof | send_failed | error) with duration and bytes_in/out counters. - /api/pub + /api/events: accept + structured close (reason/duration/frames) + all reject paths. - /api/ws: reject paths logged; request id threaded into handle_ws and stamped on its accept/close lines so a WS session correlates with the HTTP upgrade. Metadata only — no request/response bodies, no WS frame payloads, no headers/cookies on the INFO lines. Opt-in body capture is a separate change so this stays clear of the debug-share privacy surface. handle_ws gains an optional rid=None arg, backward-compatible with the stdio entry-point (tui_gateway.entry) which calls handle_ws(ws). Tests (behavior-contract style, not frozen strings): HTTP access line shape + query-string redaction + 401-still-logged + X-Request-ID round-trip; WS accept/close lines for /api/pub and /api/events; WS reject logging; rid propagation through handle_ws. |
||
|---|---|---|
| .. | ||
| docs | ||
| i18n/zh-Hans/docusaurus-plugin-content-docs/current | ||
| scripts | ||
| src | ||
| static | ||
| .gitignore | ||
| docusaurus.config.ts | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| sidebars.ts | ||
| tsconfig.json | ||
Website
This website is built using Docusaurus, a modern static website generator.
Installation
yarn
Local Development
yarn start
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Build
yarn build
This command generates static content into the build directory and can be served using any static contents hosting service.
Deployment
Using SSH:
USE_SSH=true yarn deploy
Not using SSH:
GIT_USER=<Your GitHub username> yarn deploy
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.
Diagram Linting
CI runs ascii-guard to lint docs for ASCII box diagrams. Use Mermaid (````mermaid`) or plain lists/tables instead of ASCII boxes to avoid CI failures.