From 1b8de3457d82e4e585e23ea1d7c0d50fb8bdc605 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 22:53:16 -0700 Subject: [PATCH] refactor(hermes_cli): repoint callable-api-key source-inspection test at the guard expression --- tests/run_agent/test_callable_api_key.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run_agent/test_callable_api_key.py b/tests/run_agent/test_callable_api_key.py index 6588da27a1..e6b647b3d3 100644 --- a/tests/run_agent/test_callable_api_key.py +++ b/tests/run_agent/test_callable_api_key.py @@ -254,9 +254,9 @@ class TestCliEnsureRuntimeCredentialsCallable: # module the method actually lives in now. src = (Path(__file__).resolve().parent.parent.parent / "hermes_cli" / "cli_agent_setup_mixin.py").read_text() - # The fix introduces ``_is_callable_provider`` which gates the - # string-only check so callable token providers survive. - assert "_is_callable_provider = callable(api_key)" in src, ( + # The fix gates the string-only check on ``callable(api_key)`` so callable + # token providers survive. + assert "if not callable(api_key) and not (isinstance(api_key, str) and api_key):" in src, ( "_ensure_runtime_credentials must preserve a callable " "api_key (Entra ID bearer provider). Without the guard, the " "callable is stringified to 'no-key-required' and Azure 401s."