async def test_files_request_instruction(
        self,
        mock_run_git,
        mock_status,
        mock_find_repos,
        tool,
    ):
        """Test that file request instruction is added when no files provided"""
        mock_find_repos.return_value = ["/test/repo"]
        mock_status.return_value = {
            "branch": "main",
            "ahead": 0,
            "behind": 0,
            "staged_files": ["file1.py"],
            "unstaged_files": [],
        }

        mock_run_git.side_effect = [
            (True, "file1.py\n"),  # staged files
            (True, "diff --git a/file1.py..."),  # diff for file1.py
            (True, ""),  # unstaged files (empty)
        ]

        # Request without files
        request = PrecommitRequest(path="/absolute/repo/path")
        result = await tool.prepare_prompt(request)

        # Should include instruction for requesting files
        assert "If you need additional context files" in result
        assert "standardized JSON response format" in result

        # Request with files - should not include instruction
        request_with_files = PrecommitRequest(path="/absolute/repo/path", files=["/some/file.py"])

        # Need to reset mocks for second call
        mock_find_repos.return_value = ["/test/repo"]
        mock_run_git.side_effect = [
            (True, "file1.py\n"),  # staged files
            (True, "diff --git a/file1.py..."),  # diff for file1.py
            (True, ""),  # unstaged files (empty)
        ]

        # Mock the centralized file preparation method to return empty (file not found)
        with patch.object(tool, "_prepare_file_content_for_prompt") as mock_prepare_files:
            mock_prepare_files.return_value = ""
            result_with_files = await tool.prepare_prompt(request_with_files)

        assert "If you need additional context files" not in result_with_files
Test that file request instruction is added when no files provided
tests/test_precommit.py