From 97aba0140620d7235b68098afda369c5a34a3966 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 29 Jul 2026 11:58:18 -0700 Subject: [PATCH] test: patch load_config_readonly alongside load_config in run_agent init tests agent_init's config reads now go through load_config_readonly(); 8 tests that stubbed only load_config stopped intercepting them. Each of the 10 patch sites gains a sibling readonly patch with the same return_value. 461/461 file-local tests green. --- tests/run_agent/test_run_agent.py | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/run_agent/test_run_agent.py b/tests/run_agent/test_run_agent.py index e87c14a3536..364fbf23c90 100644 --- a/tests/run_agent/test_run_agent.py +++ b/tests/run_agent/test_run_agent.py @@ -1072,6 +1072,10 @@ class TestInit: patch("run_agent.check_toolset_requirements", return_value={}), patch("run_agent.OpenAI"), patch("hermes_cli.config.load_config", return_value={}), + patch( + "hermes_cli.config.load_config_readonly", + return_value={}, + ), ): a = AIAgent( api_key="test-k...7890", @@ -1093,6 +1097,10 @@ class TestInit: "hermes_cli.config.load_config", return_value={"prompt_caching": {"cache_ttl": "1h"}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"prompt_caching": {"cache_ttl": "1h"}}, + ), ): a = AIAgent( api_key="test-k...7890", @@ -1114,6 +1122,10 @@ class TestInit: "hermes_cli.config.load_config", return_value={"model": {"max_tokens": 4096}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"model": {"max_tokens": 4096}}, + ), ): a = AIAgent( api_key="test-k...7890", @@ -1140,6 +1152,10 @@ class TestInit: "hermes_cli.config.load_config", return_value={"model": {"max_tokens": 4096}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"model": {"max_tokens": 4096}}, + ), ): a = AIAgent( api_key="test-k...7890", @@ -1164,6 +1180,10 @@ class TestInit: "hermes_cli.config.load_config", return_value={"prompt_caching": {"cache_ttl": "30m"}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"prompt_caching": {"cache_ttl": "30m"}}, + ), ): a = AIAgent( api_key="test-k...7890", @@ -1498,6 +1518,10 @@ class TestToolUseEnforcementConfig: "hermes_cli.config.load_config", return_value={"agent": {"tool_use_enforcement": tool_use_enforcement}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"agent": {"tool_use_enforcement": tool_use_enforcement}}, + ), ): a = AIAgent( model=model, @@ -1644,6 +1668,10 @@ class TestToolUseEnforcementConfig: "hermes_cli.config.load_config", return_value={"agent": {"tool_use_enforcement": True}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"agent": {"tool_use_enforcement": True}}, + ), ): a = AIAgent( api_key="test-key-1234567890", @@ -1681,6 +1709,10 @@ class TestTaskCompletionGuidance: "hermes_cli.config.load_config", return_value={"agent": agent_cfg}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"agent": agent_cfg}, + ), ): a = AIAgent( model=model, @@ -1738,6 +1770,10 @@ class TestTaskCompletionGuidance: "hermes_cli.config.load_config", return_value={"agent": {"task_completion_guidance": True}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"agent": {"task_completion_guidance": True}}, + ), ): a = AIAgent( api_key="test-key-1234567890", @@ -1770,6 +1806,10 @@ class TestEnvironmentProbeIntegration: "hermes_cli.config.load_config", return_value={"agent": {"environment_probe": environment_probe}}, ), + patch( + "hermes_cli.config.load_config_readonly", + return_value={"agent": {"environment_probe": environment_probe}}, + ), ): a = AIAgent( model=model,