From b0bde329591114e0ec7dde464e48846f02f549df Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 15 Sep 2026 12:36:14 -0700 Subject: [PATCH] test(cron): bot-chat CLI-home test strips the launcher prefix without requiring -p The fixture adaptation for the `python -m hermes_cli.main` launcher located the CLI argv via `argv.index("-p")`, but profile homes (`profiles/`) never get a `-p` flag appended, so the `beta` parametrization raised ValueError inside the fake subprocess.run and the delivery reported failure. Strip the launcher prefix by shape instead (3 tokens for `python -m hermes_cli.main`, 1 for a binary). --- tests/cron/test_bot_chat_cli_home.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cron/test_bot_chat_cli_home.py b/tests/cron/test_bot_chat_cli_home.py index f08a3573b8..66e182c0f1 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])))