hermes-agent/website/docs/reference
kshitijk4poor d0964c5150 feat(dashboard): log HTTP access + WebSocket lifecycle to the gui surface
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.
2026-06-19 17:45:17 +05:30
..
_category_.json feat: add documentation website (Docusaurus) 2026-03-05 05:24:55 -08:00
automation-blueprints-catalog.mdx docs: finish Automation Blueprints terminology rebrand (#44470) 2026-06-11 17:22:22 -04:00
cli-commands.md feat(dashboard): log HTTP access + WebSocket lifecycle to the gui surface 2026-06-19 17:45:17 +05:30
environment-variables.md Harden hosted Docker install tree against self-modification (#47490) 2026-06-18 09:09:21 +10:00
faq.md fix(profile): make clone-from a full source selector 2026-06-13 07:33:58 -07:00
mcp-config-reference.md refactor: remove agent-callable send_message tool (#47856) 2026-06-17 07:11:23 -07:00
model-catalog.md docs: deep audit — registry drift, stale claims, 2-week PR coverage, dashboard screenshot (#40952) 2026-06-07 01:39:06 -07:00
optional-skills-catalog.md feat(skills): add html-artifact skill, fold in sketch + architecture-diagram + concept-diagrams (#48899) 2026-06-19 08:02:31 +00:00
profile-commands.md fix(profile): make clone-from a full source selector 2026-06-13 07:33:58 -07:00
skills-catalog.md feat(skills): add html-artifact skill, fold in sketch + architecture-diagram + concept-diagrams (#48899) 2026-06-19 08:02:31 +00:00
slash-commands.md docs: cross-link write-approval gate from skills, configuration, and slash-command docs (#43801) 2026-06-10 19:54:44 -07:00
tools-reference.md feat(image-gen): add image-to-image / editing to image_generate (#48705) 2026-06-18 22:13:07 -07:00
toolsets-reference.md docs: deep audit — registry drift, stale claims, 2-week PR coverage, dashboard screenshot (#40952) 2026-06-07 01:39:06 -07:00