async def test_chat_prompt_file_handling(self, temp_prompt_file, large_prompt):
        """Test that chat tool correctly handles prompt.txt files."""
        tool = ChatTool()

        # Mock the model
        with patch.object(tool, "create_model") as mock_create_model:
            mock_model = MagicMock()
            mock_response = MagicMock()
            mock_response.candidates = [
                MagicMock(
                    content=MagicMock(parts=[MagicMock(text="Processed large prompt")]),
                    finish_reason="STOP",
                )
            ]
            mock_model.generate_content.return_value = mock_response
            mock_create_model.return_value = mock_model

            # Mock read_file_content to avoid security checks
            with patch("tools.base.read_file_content") as mock_read_file:
                mock_read_file.return_value = (
                    large_prompt,
                    1000,
                )  # Return tuple like real function

                # Execute with empty prompt and prompt.txt file
                result = await tool.execute({"prompt": "", "files": [temp_prompt_file]})

                assert len(result) == 1
                output = json.loads(result[0].text)
                assert output["status"] == "success"

                # Verify read_file_content was called with the prompt file
                mock_read_file.assert_called_once_with(temp_prompt_file)

                # Verify the large content was used
                call_args = mock_model.generate_content.call_args[0][0]
                assert large_prompt in call_args

        # Cleanup
        temp_dir = os.path.dirname(temp_prompt_file)
        shutil.rmtree(temp_dir)
Test that chat tool correctly handles prompt.txt files.
tests/test_large_prompt_handling.py