deerflow2/backend/packages/harness/deerflow/sandbox
Xinmin Zeng 6a4a30fa2b
fix(sandbox): return actionable hint when read_file hits a binary file (#3624)
read_file decodes with UTF-8. Binary uploads (.xlsx, images, ...) raise
UnicodeDecodeError in the sandbox layer. UnicodeDecodeError is a ValueError
subclass, not an OSError, so it bypassed the typed handlers and fell through
to the generic except, surfacing a vague "Unexpected error reading file"
message. The model could not tell the file was binary, so it retried
read_file instead of switching to bash + pandas/openpyxl, burning LLM
round-trips and bloating context with repeated failures.

Add a dedicated UnicodeDecodeError handler that tells the model the file is
binary and to use bash with a suitable library (or view_image for images).
2026-06-17 21:11:44 +08:00
..
local fix(sandbox): make missing sandbox.mounts host_path a loud ERROR (#3244) (#3250) 2026-06-09 23:16:14 +08:00
__init__.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
exceptions.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
file_operation_lock.py fix(sandbox): prevent memory leak in file operation locks using WeakValueDictionary (#2096) 2026-04-10 22:55:53 +08:00
middleware.py fix(sandbox): persist lazily-acquired sandbox state via Command (#3464) 2026-06-11 17:50:36 +08:00
sandbox_provider.py fix(sandbox): add group/other read permissions to uploaded files for Docker sandbox (#3127) (#3134) 2026-05-25 09:26:18 +08:00
sandbox.py feat(sandbox) Adds download file interface in Sandbox (#3038) 2026-05-20 10:16:31 +08:00
search.py feat(sandbox): add built-in grep and glob tools (#1784) 2026-04-03 16:03:06 +08:00
security.py fix(sandbox): improve sandbox security and preserve multimodal content (#2114) 2026-04-11 16:52:10 +08:00
tools.py fix(sandbox): return actionable hint when read_file hits a binary file (#3624) 2026-06-17 21:11:44 +08:00