summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_agent.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_agent.py b/tests/test_agent.py
index c8164e6..e73b41e 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -173,10 +173,10 @@ class TestAgentRun:
)
agent.client.chat.completions.create.side_effect = [tool_response, final_response]
- # json.loads will raise — this should be caught or propagate clearly
- # Current code does NOT catch this, so it should raise JSONDecodeError
- with pytest.raises(json.JSONDecodeError):
- agent.run("Do something")
+ # json.loads will fail, the agent will catch it, return an error to model,
+ # and on the next turn the model will return "Recovered".
+ result = agent.run("Do something")
+ assert result == "Recovered"
def test_api_error_propagates(self, agent):
"""API errors should propagate, not be silently swallowed."""