async def test_malformed_clarification_request_treated_as_normal(self, mock_create_model, analyze_tool):
        """Test that malformed JSON clarification requests are treated as normal responses"""
        malformed_json = '{"status": "requires_clarification", "question": "Missing closing brace"'

        mock_model = Mock()
        mock_model.generate_content.return_value = Mock(
            candidates=[Mock(content=Mock(parts=[Mock(text=malformed_json)]))]
        )
        mock_create_model.return_value = mock_model

        result = await analyze_tool.execute({"files": ["/absolute/path/test.py"], "question": "What does this do?"})

        assert len(result) == 1

        # Should be treated as normal response due to JSON parse error
        response_data = json.loads(result[0].text)
        assert response_data["status"] == "success"
        assert malformed_json in response_data["content"]
Test that malformed JSON clarification requests are treated as normal responses
tests/test_collaboration.py