mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-11 08:42:11 +00:00
feat(gui): route embedded TUI through dashboard gateway (#21979)
Inject HERMES_TUI_GATEWAY_URL into dashboard PTY sessions so embedded ui-tui instances attach to the in-process websocket gateway, with coverage for the new env wiring.
This commit is contained in:
parent
5e4f2301f8
commit
a02ea9d8ff
2 changed files with 41 additions and 0 deletions
|
|
@ -2257,3 +2257,23 @@ class TestPtyWebSocket:
|
|||
):
|
||||
pass
|
||||
assert exc.value.code == 4400
|
||||
|
||||
|
||||
def test_resolve_chat_argv_injects_gateway_ws_url(monkeypatch):
|
||||
import hermes_cli.main as cli_main
|
||||
import hermes_cli.web_server as ws
|
||||
|
||||
monkeypatch.setattr(
|
||||
cli_main,
|
||||
"_make_tui_argv",
|
||||
lambda *_args, **_kwargs: (["node", "fake-tui.js"], Path("/tmp")),
|
||||
)
|
||||
monkeypatch.setattr(ws.app.state, "bound_host", "127.0.0.1", raising=False)
|
||||
monkeypatch.setattr(ws.app.state, "bound_port", 9119, raising=False)
|
||||
|
||||
_argv, _cwd, env = ws._resolve_chat_argv()
|
||||
|
||||
assert env is not None
|
||||
gateway_url = env.get("HERMES_TUI_GATEWAY_URL", "")
|
||||
assert gateway_url.startswith("ws://127.0.0.1:9119/api/ws?")
|
||||
assert "token=" in gateway_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue