core/config: top-level [plugins] enable/disable allowlist

This commit is contained in:
2026-07-24 16:19:50 +08:00
parent 278c930fae
commit 4215a8cea0
9 changed files with 100 additions and 38 deletions
+18 -2
View File
@@ -26,8 +26,8 @@ def test_agent_section_defaults(tmp_path: Path) -> None:
assert store.agent_config.confirm_destructive is True
assert store.agent_config.path_denylist == []
assert store.agent_config.max_context_tokens == 200_000
assert store.agent_config.tool_plugins == []
assert store.agent_config.tool_plugins_disable == []
assert store.plugins_config.enable == []
assert store.plugins_config.disable == []
def test_compose_defaults_join_persona_and_directives() -> None:
@@ -138,3 +138,19 @@ tool_directives = ""
)
is None
)
def test_plugins_section_parse(tmp_path: Path) -> None:
path = tmp_path / "c.toml"
_ = path.write_text(
"""
[plugins]
enable = ["acme", "*"]
disable = ["legacy"]
""",
encoding="utf-8",
)
store = load(path)
assert store.plugins_config.enable == ["acme", "*"]
assert store.plugins_config.disable == ["legacy"]
assert store.plugins["enable"] == ["acme", "*"]