From 4b90718191667cd5c39c5a59902f165483ab15a8 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Wed, 21 Oct 2026 20:26:08 +0800 Subject: [PATCH] core/config: re-read [skills] on reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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. --- src/plyngent/config/store.py | 1 + tests/test_config/test_skills_section.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/plyngent/config/store.py b/src/plyngent/config/store.py index fa5603e..bba0944 100644 --- a/src/plyngent/config/store.py +++ b/src/plyngent/config/store.py @@ -494,6 +494,7 @@ class ConfigStore: self._plugins = _parse_plugins(cast("dict[str, object]", raw.get("plugins", {}))) self._networking = _parse_networking(cast("dict[str, object]", raw.get("networking", {}))) self._mcp = _parse_mcp(cast("dict[str, object]", raw.get("mcp", {}))) + self._skills = _parse_skills(cast("dict[str, object]", raw.get("skills", {}))) self._notify = _parse_notify(cast("dict[str, object]", raw.get("notify", {}))) self._trash = _parse_trash(cast("dict[str, object]", raw.get("trash", {}))) self._providers, self._bad_providers, self._recoverable_providers = _parse_providers(self._document) diff --git a/tests/test_config/test_skills_section.py b/tests/test_config/test_skills_section.py index 0214774..9fa9bc4 100644 --- a/tests/test_config/test_skills_section.py +++ b/tests/test_config/test_skills_section.py @@ -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"