feat(api-server): add read-only sessions, memory, skills, config endpoints - #6334
feat(api-server): add read-only sessions, memory, skills, config endpoints#6334outsourc-e wants to merge 1 commit into
Conversation
…oints
Adds purely additive read-only and metadata endpoints to the gateway
API server. All chat continues to flow through /v1/chat/completions
exclusively — no parallel agent lifecycle or gateway runner bypass.
New endpoints:
- GET /api/sessions — list sessions (paginated)
- POST /api/sessions — create session (metadata only)
- GET /api/sessions/{id} — session details
- PATCH /api/sessions/{id} — update title
- DELETE /api/sessions/{id} — delete session
- GET /api/sessions/{id}/messages — message history
- GET /api/memory — read memory files (MEMORY.md, USER.md)
- GET /api/skills — list installed skills with frontmatter
- GET /api/config — safe config subset (API keys stripped)
All handlers use the existing _check_auth() gate and follow
established aiohttp patterns. Session endpoints delegate to the
existing SessionDB (list_sessions_rich, get_session, get_messages,
create_session, set_session_title, delete_session).
This enables web UIs like Hermes Workspace to connect to hermes
--gateway for session management, memory browsing, and skill
inspection while keeping chat on the gateway's existing message
handling pipeline.
Follows up on NousResearch#4639 feedback — read-only endpoints approved,
chat endpoints removed in favor of /v1/chat/completions.
|
Superseded by #8556 which adds the same read-only endpoints plus session chat (sync + SSE streaming), memory CRUD, config write, capability probes, and 91 tests. |
|
Closing in favor of #8556 which supersedes this with a complete session management API (20 endpoints including streaming chat, memory CRUD, config write, capability probes, and 91 tests). |
|
Superseded by #8556 which adds a more complete session management API. Consider closing in favor of that PR. |
|
Superseded by #8556. |
|
Thanks for opening this @outsourc-e — closing in favor of the focused split that's actually shipping:
Your PR is the original instance of this idea (April 8) and predates both #8556 and #29302. Credit retained in the lineage. The follow-up PR will link back here. Closing as superseded — not as rejected. Thanks for the contribution. |
Summary
Adds read-only and metadata endpoints to
gateway/platforms/api_server.pythat enable web UIs to inspect gateway state without bypassing the existing message handling pipeline.All chat continues to flow through
/v1/chat/completionsexclusively — no parallel agent lifecycle, no directAIAgentcalls, no gateway runner bypass.This follows up on #4639 feedback from @teknium1:
What changed (1 file, purely additive)
Sessions (delegates to existing SessionDB)
GET /api/sessions— list sessions (paginated vialist_sessions_rich)POST /api/sessions— create session (metadata only, viacreate_session)GET /api/sessions/{id}— session details (viaget_session)PATCH /api/sessions/{id}— update title (viaset_session_title)DELETE /api/sessions/{id}— delete session (viadelete_session)GET /api/sessions/{id}/messages— message history (viaget_messages)Memory, Skills, Config (read-only)
GET /api/memory— reads~/.hermes/memories/files (MEMORY.md, USER.md)GET /api/skills— scans installed skill directories, parses YAML frontmatterGET /api/config— returns safe config subset (API keys stripped)Architecture
_check_auth()gateSessionDB— the same database that/v1/chat/completionsalready writes to/v1/chat/completionswithX-Hermes-Session-Idfor session continuityWhy
The existing
/v1/chat/completionsendpoint handles agent creation, session persistence, and streaming. These additions fill the gap for stateful web UIs that need to read sessions, memory, and skills — following the same aiohttp patterns already established.Testing
hermes --gateway/v1/chat/completions+X-Hermes-Session-Idwith session continuity confirmed