opentui(phase3): launcher integration — HERMES_TUI_ENGINE dual-engine
hermes --tui launches the native OpenTUI engine (Bun) when HERMES_TUI_ENGINE=opentui (env) or display.tui_engine=opentui (config); Ink stays the default and the shipping path is untouched. - _resolve_tui_engine() (env > config > ink); refuses opentui on Windows/Termux (no Bun) -> falls back to ink with a notice. - _make_opentui_argv() -> [bun, src/entry.real.tsx] (no build step). - _bun_bin() with HERMES_BUN override. - Branch at top of _make_tui_argv BEFORE _ensure_tui_node (Bun-only host must not bootstrap Node). - Gate _launch_tui NODE_OPTIONS/--max-old-space-size on engine==ink (Bun is JSC; the V8 flag errors/ignores). Verified end-to-end via tmux: real hermes --tui -> Bun -> OpenTUI -> real Python gateway streamed a real reply. No-flag default still ink.
This commit is contained in:
@@ -613,44 +613,6 @@ def test_session_resume_live_payload_uses_current_history_with_ancestors(server,
|
||||
]
|
||||
|
||||
|
||||
def test_session_activate_rebinds_orphaned_ws_session_to_current_transport(server, monkeypatch):
|
||||
"""Reconnect + activate must reattach a parked live session before orphan reap."""
|
||||
|
||||
class _Transport:
|
||||
def write(self, _obj):
|
||||
return True
|
||||
|
||||
sid = "runtime01"
|
||||
old_transport = server._stdio_transport
|
||||
new_transport = _Transport()
|
||||
server._sessions[sid] = {
|
||||
"agent": types.SimpleNamespace(model="test/model"),
|
||||
"created_at": 123.0,
|
||||
"history": [],
|
||||
"history_lock": threading.RLock(),
|
||||
"last_active": 123.0,
|
||||
"running": False,
|
||||
"session_key": "20260409_010101_abc123",
|
||||
"transport": old_transport,
|
||||
}
|
||||
monkeypatch.setattr(server, "current_transport", lambda: new_transport)
|
||||
monkeypatch.setattr(server, "_get_db", lambda: None)
|
||||
monkeypatch.setattr(
|
||||
server,
|
||||
"_session_info",
|
||||
lambda _agent, _session=None: {"model": "test/model"},
|
||||
)
|
||||
|
||||
resp = server.handle_request(
|
||||
{"id": "activate", "method": "session.activate", "params": {"session_id": sid}}
|
||||
)
|
||||
|
||||
assert "error" not in resp
|
||||
assert resp["result"]["session_id"] == sid
|
||||
assert server._sessions[sid]["transport"] is new_transport
|
||||
assert not server._ws_session_is_orphaned(server._sessions[sid])
|
||||
|
||||
|
||||
def test_session_branch_persists_branched_from_marker(server, monkeypatch):
|
||||
"""TUI /branch must persist a _branched_from marker so the branch stays
|
||||
visible in /resume and /sessions.
|
||||
|
||||
Reference in New Issue
Block a user