test(model): clear COPILOT_ACP_BASE_URL in the copilot-acp fixture

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.
This commit is contained in:
Solitud1nem
2026-07-16 10:24:54 +03:00
committed by kshitij
parent 1e8f829f1a
commit 6b00567718
@@ -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