mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
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.
This commit is contained in:
parent
61ac118724
commit
4b6d68bd64
1 changed files with 9 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue