From 76fea442d477e8ba7556e4b841e2f8280ec5720e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 05:38:46 +0000 Subject: [PATCH] Fix LiteAgent test mocking: return AgentFinish object instead of raw string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mock _invoke_loop to return proper AgentFinish object with output attribute - This should resolve the 'str' object has no attribute 'output' error in CI Co-Authored-By: João --- tests/test_integration_llm_features.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_integration_llm_features.py b/tests/test_integration_llm_features.py index 9d0962f19..9a7d04dfd 100644 --- a/tests/test_integration_llm_features.py +++ b/tests/test_integration_llm_features.py @@ -75,7 +75,9 @@ class TestIntegrationLLMFeatures: ) with patch.object(lite_agent, '_invoke_loop') as mock_invoke: - mock_invoke.return_value = response_with_xml + from crewai.agents.agent_action import AgentFinish + mock_agent_finish = AgentFinish(output=response_with_xml, text=response_with_xml) + mock_invoke.return_value = mock_agent_finish result = lite_agent.kickoff("Analyze this problem")