Skip to content

The agent that grows with you

test: patch load_config_readonly alongside load_config in run_agent init tests

teknium197aba0140620
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,