From 4b6d68bd645fee8be171b4c7ee1e2a3ea680b456 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sat, 23 May 2026 02:40:14 -0700 Subject: [PATCH] test(fast-command): stub _load_gateway_runtime_config too PR 2362cc468 ("fix(gateway): enforce env variable template expansion on runtime config loaders") refactored `_load_service_tier` to read config via the new `_load_gateway_runtime_config` wrapper instead of opening `_hermes_home/config.yaml` directly. The `test_run_agent_passes_priority_processing_to_gateway_agent` test still only stubbed `_load_gateway_config` (the inner loader), so the runtime wrapper saw an empty config and `_load_service_tier` returned None, breaking the test: FAILED tests/gateway/test_fast_command.py::test_run_agent_passes_priority_processing_to_gateway_agent - AssertionError: assert None == 'priority' Fix: also stub `_load_gateway_runtime_config` to return the expected `agent.service_tier=fast` config, so the test once again drives the priority routing path it was written to verify. Confirmed reproducing on current main before the patch and passing after. --- tests/gateway/test_fast_command.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/gateway/test_fast_command.py b/tests/gateway/test_fast_command.py index c904b659d1b..58db9faf05e 100644 --- a/tests/gateway/test_fast_command.py +++ b/tests/gateway/test_fast_command.py @@ -148,6 +148,15 @@ async def test_run_agent_passes_priority_processing_to_gateway_agent(monkeypatch monkeypatch.setattr(gateway_run, "_env_path", tmp_path / ".env") monkeypatch.setattr(gateway_run, "load_dotenv", lambda *args, **kwargs: None) monkeypatch.setattr(gateway_run, "_load_gateway_config", lambda: {}) + # ``_load_service_tier`` was refactored to call ``_load_gateway_runtime_config`` + # (which wraps ``_load_gateway_config`` plus env-expansion). Since the test + # stubs ``_load_gateway_config`` to ``{}``, also stub the runtime wrapper + # directly so the priority routing assertions still exercise the live tier. + monkeypatch.setattr( + gateway_run, + "_load_gateway_runtime_config", + lambda: {"agent": {"service_tier": "fast"}}, + ) monkeypatch.setattr(gateway_run, "_resolve_gateway_model", lambda config=None: "gpt-5.4") monkeypatch.setattr( gateway_run,