mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-04 07:31:58 +00:00
perf(termux): speed up bare cli prompt startup
This commit is contained in:
parent
6c3fd9714f
commit
a3beee475b
3 changed files with 343 additions and 79 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from argparse import Namespace
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import types
|
||||
|
|
@ -312,6 +313,37 @@ def test_termux_fast_cli_launch_chat_uses_light_parser(monkeypatch, main_mod):
|
|||
}
|
||||
|
||||
|
||||
def test_termux_fast_cli_launch_bare_defers_agent_startup(monkeypatch, main_mod):
|
||||
captured = {}
|
||||
prepared = []
|
||||
|
||||
monkeypatch.setenv("TERMUX_VERSION", "1")
|
||||
monkeypatch.delenv("HERMES_TUI", raising=False)
|
||||
monkeypatch.delenv("HERMES_DEFER_AGENT_STARTUP", raising=False)
|
||||
monkeypatch.delenv("HERMES_FAST_STARTUP_BANNER", raising=False)
|
||||
monkeypatch.setattr(sys, "argv", ["hermes"])
|
||||
monkeypatch.setattr(
|
||||
main_mod, "_prepare_agent_startup", lambda args: prepared.append(args.command)
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
main_mod,
|
||||
"cmd_chat",
|
||||
lambda args: captured.update(
|
||||
{
|
||||
"query": args.query,
|
||||
"command": args.command,
|
||||
"compact": getattr(args, "compact", False),
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
assert main_mod._try_termux_fast_cli_launch() is True
|
||||
assert prepared == []
|
||||
assert captured == {"query": None, "command": None, "compact": True}
|
||||
assert os.environ["HERMES_DEFER_AGENT_STARTUP"] == "1"
|
||||
assert os.environ["HERMES_FAST_STARTUP_BANNER"] == "1"
|
||||
|
||||
|
||||
def test_termux_fast_cli_launch_oneshot_uses_light_parser(monkeypatch, main_mod):
|
||||
captured = {}
|
||||
prepared = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue