The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor: hoist binary_extensions import to module level
kshitij9f004c821796
diff --git a/tools/file_tools.py b/tools/file_tools.pyindex 735880d33e0..2270fb57f6b 100644--- a/tools/file_tools.py+++ b/tools/file_tools.py@@ -12,7 +12,11 @@ import threadingfrom pathlib import Path, PurePosixPathfrom agent.file_safety import get_read_block_error-from tools.binary_extensions import has_binary_extension+from tools.binary_extensions import (+ has_binary_extension,+ has_opaque_document_extension,+ is_pdf_path,+)from tools.file_operations import (ShellFileOperations,normalize_read_pagination,@@ -2186,7 +2190,6 @@ def _check_binary_document_write(filepath: str, task_id: str = "default") -> str- .pdf: rejected only when OVERWRITING an existing regular file. Raw PDFsyntax is text-authorable, so new-file creation stays allowed."""- from tools.binary_extensions import has_opaque_document_extension, is_pdf_pathif has_opaque_document_extension(filepath):ext = filepath[filepath.rfind("."):].lower()return (