From 754fdbdc9863048d584b9754e36990d67935caa2 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 28 Jul 2026 10:52:28 -0700 Subject: [PATCH] test: set HERMES_HOME in _persist_model_switch tests after save_config_value fix The prior commit made save_config_value resolve its target via get_hermes_home() (live env) instead of the import-time cli._hermes_home constant. Two _persist_model_switch tests patched only cli._hermes_home and wrote/read tmp_path/config.yaml, so the write now landed in the real HERMES_HOME and the readback saw stale values. Set HERMES_HOME=tmp_path (kept the _hermes_home patch for belt-and-suspenders). No production change. --- tests/test_tui_gateway_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_tui_gateway_server.py b/tests/test_tui_gateway_server.py index 5ff4032772b..96f152e3d79 100644 --- a/tests/test_tui_gateway_server.py +++ b/tests/test_tui_gateway_server.py @@ -13944,9 +13944,9 @@ def test_persist_model_switch_preserves_sibling_model_keys(tmp_path, monkeypatch "agent:\n" " system_prompt: keepme\n" ) - # save_config_value() resolves the config path from cli._hermes_home, which - # is captured at import time — patch it directly (set_hermes_home_override - # does NOT affect this snapshot). + # save_config_value() resolves the config path from get_hermes_home() (live + # env var), always targeting HERMES_HOME/config.yaml — point it at tmp_path. + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) monkeypatch.setattr(cli, "_hermes_home", tmp_path) result = types.SimpleNamespace( @@ -13979,6 +13979,7 @@ def test_persist_model_switch_clears_stale_base_url(tmp_path, monkeypatch): " provider: custom:mylocal\n" " base_url: http://localhost:1234/v1\n" ) + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) monkeypatch.setattr(cli, "_hermes_home", tmp_path) # Switch to a native provider with no base_url.