mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-02 16:26:34 +08:00
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.
47 lines
1.8 KiB
Python
47 lines
1.8 KiB
Python
"""Fixtures shared across hermes_cli kanban tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def all_assignees_spawnable(monkeypatch):
|
|
"""Pretend every assignee maps to a real Hermes profile.
|
|
|
|
Most dispatcher tests use synthetic assignees ("alice", "bob") that
|
|
don't correspond to actual profile directories on disk. Without this
|
|
patch, the dispatcher's profile-exists guard (PR #20105) routes
|
|
those tasks into ``skipped_nonspawnable`` instead of spawning, which
|
|
would break tests that assert spawn behavior.
|
|
"""
|
|
from hermes_cli import profiles
|
|
monkeypatch.setattr(profiles, "profile_exists", lambda name: True)
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _suppress_concurrent_hermes_gate(request, monkeypatch):
|
|
"""Default ``_detect_concurrent_hermes_instances`` to ``[]`` for every test.
|
|
|
|
The Windows update path now refuses to proceed when another
|
|
``hermes.exe`` is detected (issue #26670). On a developer's Windows
|
|
machine running the test suite via ``hermes`` itself, this would
|
|
flag the running agent as a concurrent instance and abort every
|
|
``cmd_update`` test. Tests that want to exercise the gate explicitly
|
|
re-patch ``_detect_concurrent_hermes_instances`` with their own
|
|
return value — autouse here gives a clean default without touching
|
|
the rest of the suite.
|
|
|
|
Tests that need to call the REAL function (e.g. unit tests for the
|
|
helper itself) opt out with ``@pytest.mark.real_concurrent_gate``.
|
|
"""
|
|
if request.node.get_closest_marker("real_concurrent_gate"):
|
|
return
|
|
try:
|
|
from hermes_cli import main as _cli_main
|
|
except Exception:
|
|
return
|
|
monkeypatch.setattr(
|
|
_cli_main, "_detect_concurrent_hermes_instances", lambda *_a, **_k: []
|
|
)
|