agent: Truncate bash tool output (#28291)
The bash tool will now truncate its output to 8192 bytes (or the last newline before that). We also added a global limit for any tool that produces a clearly large output that wouldn't fit the context window. Release Notes: - agent: Truncate bash tool output --------- Co-authored-by: Michael Sloan <mgsloan@gmail.com>
This commit is contained in:
co-authored by
Michael Sloan
parent
1774cad933
commit
85c5d8af3a
@@ -1487,6 +1487,7 @@ impl Thread {
|
||||
tool_use_id.clone(),
|
||||
tool_name,
|
||||
output,
|
||||
cx,
|
||||
);
|
||||
|
||||
cx.emit(ThreadEvent::ToolFinished {
|
||||
@@ -1831,7 +1832,7 @@ impl Thread {
|
||||
));
|
||||
|
||||
self.tool_use
|
||||
.insert_tool_output(tool_use_id.clone(), tool_name, err);
|
||||
.insert_tool_output(tool_use_id.clone(), tool_name, err, cx);
|
||||
|
||||
cx.emit(ThreadEvent::ToolFinished {
|
||||
tool_use_id,
|
||||
|
||||
Reference in New Issue
Block a user