draft: add gateway-backed WebUI chat mode#2553
Draft
AJV20 wants to merge 2 commits into
Draft
Conversation
(cherry picked from commit cf69b4053c8f756f7c6f62109bf7f2ae0446af4c)
…chat # Conflicts: # CHANGELOG.md # api/routes.py
Contributor
Author
|
Updated the draft branch in What changed:
Verification:
|
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.
Thinking Path
WebUI currently has a direct in-process chat execution path, while messaging surfaces go through Hermes gateway/runtime paths. This draft PR introduces an opt-in gateway-backed browser chat mode so maintainers can review the architectural direction without changing default behavior.
What Changed
HERMES_WEBUI_CHAT_BACKEND=gatewayto route/api/chat/startturns through Hermes Gateway/API Server.HERMES_WEBUI_GATEWAY_BASE_URLandHERMES_WEBUI_GATEWAY_API_KEY/API_SERVER_KEYhandling for the gateway connection.hermes.tool.progressevents back into the existing WebUI SSE events (token,tool,done,stream_end)._start_chat_stream_for_session(...)path as the default fallback.ARCHITECTURE.mdand adds static regression coverage for the opt-in branch and streaming mapping.Why It Matters
This is a reversible architecture slice for making WebUI behave more like Hermes messaging surfaces by delegating execution to the gateway/runtime layer instead of constructing
AIAgentdirectly in WebUI. It is intentionally draft/default-off so maintainers can evaluate config, auth, cancellation, attachment, and runtime-ownership tradeoffs before considering merge readiness.Verification
Set
HERMES_AGENT_PYto the Hermes Agent virtualenv Python for your install, for example~/.hermes/hermes-agent/venv/bin/python.$HERMES_AGENT_PY -m py_compile api/routes.py api/config.py api/streaming.py$HERMES_AGENT_PY -m pytest tests/test_gateway_chat_bridge.py tests/test_sprint42.py -q33 passed in 2.20s/healthreturned OK and/v1/chat/completionsreturned the expectedgateway-okresponse.Risks / Follow-ups
Model Used
OpenAI Codex CLI via Hermes Agent, with terminal/file tools for implementation, tests, git, and GitHub REST automation.