Skip to content

The agent that grows with you

test(cron): bot-chat CLI-home test strips the launcher prefix without requiring -p

teknium1b0bde3295911
diff --git a/tests/cron/test_bot_chat_cli_home.py b/tests/cron/test_bot_chat_cli_home.py
index f08a3573b8f..66e182c0f1d 100644
--- a/tests/cron/test_bot_chat_cli_home.py
+++ b/tests/cron/test_bot_chat_cli_home.py
@@ -35,7 +35,8 @@ def test_cli_keeps_discovered_home_when_launch_selection_changes(tmp_path, monke
'import hermes_cli.main; from hermes_constants import get_hermes_home; '
'print(json.dumps(str(get_hermes_home())))')
# Everything after the launcher (binary or ``python -m hermes_cli.main``) is the CLI argv.
- result = real_run([sys.executable, "-c", code, json.dumps(argv[argv.index("-p"):])],
+ cli_argv = argv[3:] if argv[1:3] == ["-m", "hermes_cli.main"] else argv[1:]
+ result = real_run([sys.executable, "-c", code, json.dumps(cli_argv)],
env=kwargs["env"], capture_output=True, text=True, timeout=30)
assert result.returncode == 0, result.stderr
seen.append(Path(json.loads(result.stdout.strip().splitlines()[-1])))