mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +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:
@@ -17,7 +17,7 @@ def test_agent_section_defaults(tmp_path: Path) -> None:
|
||||
assert store.agent_config.parallel_tools is True
|
||||
assert store.agent_config.confirm_destructive is True
|
||||
assert store.agent_config.path_denylist == []
|
||||
assert store.agent_config.max_context_chars == 200_000
|
||||
assert store.agent_config.max_context_tokens == 200_000
|
||||
|
||||
|
||||
def test_agent_section_parse(tmp_path: Path) -> None:
|
||||
@@ -30,7 +30,7 @@ max_tool_result_chars = 100
|
||||
parallel_tools = false
|
||||
confirm_destructive = false
|
||||
path_denylist = ["/secrets/", ".ssh/"]
|
||||
max_context_chars = 5000
|
||||
max_context_tokens = 5000
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
@@ -40,4 +40,5 @@ max_context_chars = 5000
|
||||
assert store.agent_config.parallel_tools is False
|
||||
assert store.agent_config.confirm_destructive is False
|
||||
assert store.agent_config.path_denylist == ["/secrets/", ".ssh/"]
|
||||
assert store.agent_config.max_context_chars == 5000
|
||||
assert store.agent_config.max_context_tokens == 5000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user