mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 23:46:50 +00:00
fix: add output truncation to ls_tool to prevent context window overflow (#1896)
ls_tool was the only sandbox tool without output size limits, allowing multi-MB results from large directories to blow up the model context window. Add head-truncation (configurable via ls_output_max_chars, default 20000) consistent with existing bash and read_file truncation. Closes #1887 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -392,10 +392,11 @@ sandbox:
|
||||
|
||||
# Tool output truncation limits (characters).
|
||||
# bash uses middle-truncation (head + tail) since errors can appear anywhere in the output.
|
||||
# read_file uses head-truncation since source code context is front-loaded.
|
||||
# read_file and ls use head-truncation since their content is front-loaded.
|
||||
# Set to 0 to disable truncation.
|
||||
bash_output_max_chars: 20000
|
||||
read_file_output_max_chars: 50000
|
||||
ls_output_max_chars: 20000
|
||||
|
||||
# Option 2: Container-based AIO Sandbox
|
||||
# Executes commands in isolated containers (Docker or Apple Container)
|
||||
|
||||
Reference in New Issue
Block a user