core/agent: add model-friendly hint to truncated tool results

This commit is contained in:
2026-08-01 01:42:17 +08:00
parent 49a3ef0004
commit 3fe1c4cf91
5 changed files with 44 additions and 7 deletions
+11 -1
View File
@@ -41,8 +41,18 @@ def test_truncate_tool_result_long() -> None:
text = "a" * 50
out = truncate_tool_result(text, 20)
assert out.startswith("a" * 20)
assert "truncated" in out
assert "Truncated" in out
assert "20" in out
assert "30" in out
assert "configuration file" in out
def test_truncate_tool_result_no_hint() -> None:
text = "a" * 50
out = truncate_tool_result(text, 20, hint=False)
assert out.startswith("a" * 20)
assert "truncated" in out
assert "configuration file" not in out
def test_compact_shrinks_old_tool_results() -> None: