mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
Rewrite all import statements, patch() targets, sys.modules keys, importlib.import_module() strings, and subprocess -m references to use hermes_agent.* paths. Strip sys.path.insert hacks from production code (rely on editable install). Update COMPONENT_PREFIXES for logger filtering. Fix 3 hardcoded getLogger() calls to use __name__. Update transport and tool registry discovery paths. Update plugin module path strings. Add legacy process-name patterns for gateway PID detection. Add main() to skills_sync for console_script entry point. Fix _get_bundled_dir() path traversal after move. Part of #14182, #14183
34 lines
883 B
Python
34 lines
883 B
Python
import sys
|
|
import types
|
|
|
|
|
|
from hermes_agent.cli.main import _prompt_reasoning_effort_selection
|
|
|
|
|
|
class _FakeTerminalMenu:
|
|
last_choices = None
|
|
|
|
def __init__(self, choices, **kwargs):
|
|
_FakeTerminalMenu.last_choices = choices
|
|
self._cursor_index = kwargs.get("cursor_index")
|
|
|
|
def show(self):
|
|
return self._cursor_index
|
|
|
|
|
|
def test_reasoning_menu_orders_minimal_before_low(monkeypatch):
|
|
fake_module = types.SimpleNamespace(TerminalMenu=_FakeTerminalMenu)
|
|
monkeypatch.setitem(sys.modules, "simple_term_menu", fake_module)
|
|
|
|
selected = _prompt_reasoning_effort_selection(
|
|
["low", "minimal", "medium", "high"],
|
|
current_effort="medium",
|
|
)
|
|
|
|
assert selected == "medium"
|
|
assert _FakeTerminalMenu.last_choices[:4] == [
|
|
" minimal",
|
|
" low",
|
|
" medium ← currently in use",
|
|
" high",
|
|
]
|