From 6b00567718f7dc44a4859715ea13fd0d92abbb79 Mon Sep 17 00:00:00 2001 From: Solitud1nem <76743883+Solitud1nem@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:24:54 +0300 Subject: [PATCH] test(model): clear COPILOT_ACP_BASE_URL in the copilot-acp fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-up: the sweeper is right that the fixture's premise leaked. It clears the tokens and both command variables, but get_auth_status() treats an `acp+tcp://` base URL as configured on its own — no executable required — so on a host that sets COPILOT_ACP_BASE_URL the missing-executable test was answering a question about the host instead of about the code. Verified by handing the test the hostile value it was vulnerable to: with COPILOT_ACP_BASE_URL=acp+tcp://127.0.0.1:9999 in the environment, test_copilot_acp_hidden_when_executable_missing fails before this commit and all three tests pass after it. --- tests/hermes_cli/test_copilot_in_model_list.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_copilot_in_model_list.py b/tests/hermes_cli/test_copilot_in_model_list.py index ff039f0a78..2889627964 100644 --- a/tests/hermes_cli/test_copilot_in_model_list.py +++ b/tests/hermes_cli/test_copilot_in_model_list.py @@ -36,8 +36,13 @@ def test_copilot_picker_uses_live_catalog_when_available(): @pytest.fixture() def _no_other_copilot_creds(monkeypatch): """Make sure copilot-acp visibility comes ONLY from executable resolution: - no env tokens, no auth-store entry, no seeded credential pool.""" - for var in ("GH_TOKEN", "GITHUB_TOKEN", "HERMES_COPILOT_ACP_COMMAND", "COPILOT_CLI_PATH"): + no env tokens, no configured ACP endpoint, no auth-store entry, no seeded + credential pool.""" + # COPILOT_ACP_BASE_URL is not a credential, but an `acp+tcp://` value marks + # the provider configured with no executable at all (hermes_cli/auth.py), so + # a host that sets it would decide the outcome instead of the test. + for var in ("GH_TOKEN", "GITHUB_TOKEN", "HERMES_COPILOT_ACP_COMMAND", + "COPILOT_CLI_PATH", "COPILOT_ACP_BASE_URL"): monkeypatch.delenv(var, raising=False) import hermes_cli.auth as auth import hermes_cli.model_switch as model_switch