mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 22:44:59 +08:00
core/agent+cli: wire max_context_chars and re-raise CancelledError
Propagate context budget from [agent] config; preserve cancel through tool invoke for mid-turn interruption.
This commit is contained in:
@@ -17,6 +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 # noqa: PLR2004
|
||||
|
||||
|
||||
def test_agent_section_parse(tmp_path: Path) -> None:
|
||||
@@ -29,6 +30,7 @@ max_tool_result_chars = 100
|
||||
parallel_tools = false
|
||||
confirm_destructive = false
|
||||
path_denylist = ["/secrets/", ".ssh/"]
|
||||
max_context_chars = 5000
|
||||
""",
|
||||
encoding="utf-8",
|
||||
)
|
||||
@@ -38,3 +40,4 @@ path_denylist = ["/secrets/", ".ssh/"]
|
||||
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 # noqa: PLR2004
|
||||
|
||||
Reference in New Issue
Block a user