async def test_clarification_request_parsing(self, mock_create_model, analyze_tool):
        """Test that tools correctly parse clarification requests"""
        # Mock model to return a clarification request
        clarification_json = json.dumps(
            {
                "status": "requires_clarification",
                "question": "I need to see the package.json file to understand dependencies",
                "files_needed": ["package.json", "package-lock.json"],
            }
        )

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

        result = await analyze_tool.execute(
            {
                "files": ["/absolute/path/src/index.js"],
                "question": "Analyze the dependencies used in this project",
            }
        )

        assert len(result) == 1

        # Parse the response
        response_data = json.loads(result[0].text)
        assert response_data["status"] == "requires_clarification"
        assert response_data["content_type"] == "json"

        # Parse the clarification request
        clarification = json.loads(response_data["content"])
        assert clarification["question"] == "I need to see the package.json file to understand dependencies"
        assert clarification["files_needed"] == ["package.json", "package-lock.json"]
Test that tools correctly parse clarification requests
tests/test_collaboration.py