From 9dbd172950a5ef04e1a2bf3ce5893fc9b2137bde Mon Sep 17 00:00:00 2001 From: Jon Saad-Falcon <41205309+jonsaadfalcon@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:09:43 -0700 Subject: [PATCH] fix: mock config in test_init_defaults to test class-level defaults The test_init_defaults test expected OperativeAgent class defaults (temperature=0.3) but didn't mock load_config(), so when config loaded successfully it returned the global default (0.7) instead. Fix: mock load_config to raise, so the test properly validates the class-level _default_temperature/max_tokens/max_turns fallback path. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/operators/test_operators.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/operators/test_operators.py b/tests/operators/test_operators.py index 065dc596..87e51eb4 100644 --- a/tests/operators/test_operators.py +++ b/tests/operators/test_operators.py @@ -485,7 +485,11 @@ class TestOperativeAgent: from openjarvis.agents.operative import OperativeAgent engine = FakeEngine() - agent = OperativeAgent(engine, "test-model") + with patch( + "openjarvis.agents._stubs.load_config", + side_effect=Exception("no config"), + ): + agent = OperativeAgent(engine, "test-model") assert agent.agent_id == "operative" assert agent._temperature == 0.3 assert agent._max_tokens == 2048