This commit is contained in:
Timothy Jaeryang Baek committed 2026-12-02 19:42:08 +04:00
1 parent a058de949f
commit 90bdabcb35
2 files changed
+34 -16

No files matched your search

+3 -1
View File
@@ -962,6 +962,7 @@ async def process_tool_result(
tool_type,
metadata=None,
user=None,
truncate=True,
):
tool_result_embeds = []
if isinstance(tool_result, MCPAppResult):
@@ -1170,7 +1171,8 @@ async def process_tool_result(
else:
tool_result = str(tool_result)
max_chars = await Config.get('tools.output_max_chars')
# truncate=False for results that stay inside a program and never reach the context.
max_chars = await Config.get('tools.output_max_chars') if truncate else None
if max_chars and tool_result and len(tool_result) > max_chars:
note = f'Truncated: {len(tool_result)} characters, limit {max_chars}'
# Machine tools read the saved file, so saving their results would only copy it again.