mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 22:44:59 +08:00
core/agent+config: soft context budget in estimated tokens
Replace max_context_chars with max_context_tokens (default 200k est. tokens via char/4); compact and /status use the token budget.
This commit is contained in:
@@ -43,7 +43,7 @@ def test_soft_compact_transcript_shrinks_tools() -> None:
|
||||
ToolChatMessage(content=big, tool_call_id="1"),
|
||||
ToolChatMessage(content="recent", tool_call_id="2"),
|
||||
]
|
||||
out = soft_compact_transcript(messages, max_chars=500)
|
||||
out = soft_compact_transcript(messages, max_tokens=100)
|
||||
assert "truncated" in out or len(out) < len(big) + 50
|
||||
assert "recent" in out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user