From 8cd456171ceb76403c9b33015f966d7378a1c5b4 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Tue, 11 Aug 2026 14:53:49 +0800 Subject: [PATCH] core/agent: drop increase-limit hint in favor of truncate tokens --- src/plyngent/agent/budget.py | 2 +- tests/test_agent/test_budget.py | 5 +++-- tests/test_agent/test_compact.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plyngent/agent/budget.py b/src/plyngent/agent/budget.py index 5135c71..13d2a98 100644 --- a/src/plyngent/agent/budget.py +++ b/src/plyngent/agent/budget.py @@ -50,7 +50,7 @@ def truncate_tool_result( return ( f"{text[:max_chars]}\n" f"...[Truncated ({max_chars} chars max.; {omitted} chars omitted). " - f"You may ask for user to increase the limit via configuration file.]" + f"Use `get_truncated` when a `TRUNCATE_TOKEN` is shown.]" ) return f"{text[:max_chars]}\n...[truncated {omitted} characters]" diff --git a/tests/test_agent/test_budget.py b/tests/test_agent/test_budget.py index 6fe5a99..64084af 100644 --- a/tests/test_agent/test_budget.py +++ b/tests/test_agent/test_budget.py @@ -15,7 +15,8 @@ def test_truncate_tool_result_long() -> None: assert "Truncated" in out assert "20" in out assert "30" in out - assert "configuration file" in out + assert "get_truncated" in out + assert "configuration file" not in out def test_truncate_tool_result_no_hint() -> None: @@ -23,7 +24,7 @@ def test_truncate_tool_result_no_hint() -> None: out = truncate_tool_result(text, 20, hint=False) assert out.startswith("a" * 20) assert "truncated" in out - assert "configuration file" not in out + assert "get_truncated" not in out def test_estimate_message_chars() -> None: diff --git a/tests/test_agent/test_compact.py b/tests/test_agent/test_compact.py index 1c12e2b..8f6656a 100644 --- a/tests/test_agent/test_compact.py +++ b/tests/test_agent/test_compact.py @@ -44,7 +44,8 @@ def test_truncate_tool_result_long() -> None: assert "Truncated" in out assert "20" in out assert "30" in out - assert "configuration file" in out + assert "get_truncated" in out + assert "configuration file" not in out def test_truncate_tool_result_no_hint() -> None: @@ -52,7 +53,7 @@ def test_truncate_tool_result_no_hint() -> None: out = truncate_tool_result(text, 20, hint=False) assert out.startswith("a" * 20) assert "truncated" in out - assert "configuration file" not in out + assert "get_truncated" not in out def test_compact_shrinks_old_tool_results() -> None: