mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 23:47:54 +08:00
core/config: re-read [skills] on reload
`ConfigStore.reload()` re-parsed every section except `[skills]`, so `/model --persist` and any other in-place reload kept serving the skill config the process started with — including `[skills].enabled`, which is what decides whether the skill tools exist at all.
This commit is contained in:
@@ -40,6 +40,17 @@ allow_write = true
|
||||
assert cfg.allow_write is True
|
||||
|
||||
|
||||
def test_skills_section_survives_reload(tmp_path: Path) -> None:
|
||||
path = tmp_path / "c.toml"
|
||||
_ = path.write_text('[skills]\npaths = ["~/a"]\n', encoding="utf-8")
|
||||
store = load(path)
|
||||
assert store.skills_config.paths == ["~/a"]
|
||||
_ = path.write_text("[skills]\nenabled = false\npaths = []\n", encoding="utf-8")
|
||||
store.reload()
|
||||
assert store.skills_config.enabled is False
|
||||
assert store.skills_config.paths == []
|
||||
|
||||
|
||||
def test_skills_section_invalid_falls_back(tmp_path: Path) -> None:
|
||||
"""An unknown discovery source or a bad type degrades to the defaults."""
|
||||
path = tmp_path / "c.toml"
|
||||
|
||||
Reference in New Issue
Block a user