Skip to content

Commit cac0a6d

Browse files
authored
Truncate content sample (#287)
- truncates content sample to 1000 chars per line for evicted large tool calls - add test group dep for parallel tests
1 parent 7350553 commit cac0a6d

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

libs/deepagents/middleware/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def _process_large_message(
603603
result = resolved_backend.write(file_path, content)
604604
if result.error:
605605
return message, None
606-
content_sample = format_content_with_line_numbers(content.splitlines()[:10], start_line=1)
606+
content_sample = format_content_with_line_numbers([line[:1000] for line in content.splitlines()[:10]], start_line=1)
607607
processed_message = ToolMessage(
608608
TOO_LARGE_TOOL_MSG.format(
609609
tool_call_id=message.tool_call_id,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Reddit = "https://www.reddit.com/r/LangChain/"
2626
test = [
2727
"pytest",
2828
"pytest-cov",
29+
"pytest-xdist",
2930
"ruff>=0.12.2,<0.13.0",
3031
"mypy>=1.18.1,<1.19.0",
3132
]

uv.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)