From 88ac15f496cde6104709ec6925212df0eb3cddc2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 25 Aug 2026 18:13:39 +0200 Subject: feat: skills config keys, on by default --- test_llamachat.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test_llamachat.py') diff --git a/test_llamachat.py b/test_llamachat.py index ef73fe3..ed990af 100755 --- a/test_llamachat.py +++ b/test_llamachat.py @@ -1137,6 +1137,35 @@ def test_config_defaults(): print("ok config defaults") +def test_skills_config(): + with tempfile.TemporaryDirectory() as tmp: + skills_dir = Path(tmp) / "skills" + (skills_dir / "firefly-cli").mkdir(parents=True) + (skills_dir / "firefly-cli" / "SKILL.md").write_text( + "---\nname: firefly-cli\ndescription: d\n---\n\nbody\n" + ) + path = Path(tmp) / "config.toml" + path.write_text(f'skills_enabled = true\nskills_dir = "{skills_dir}"\n') + cfg = config.load(path) + assert cfg.skills_enabled is True + assert cfg.skills_dir == skills_dir + + # A flag whose directory does not exist resolves to off, mirroring + # the search rule that a flag with no URL stays off. + path.write_text('skills_enabled = true\nskills_dir = "/nonexistent"\n') + assert config.load(path).skills_enabled is False + + assert config.DEFAULTS["skills_enabled"] is True + assert config.DEFAULTS["skills_dir"] == "~/.agents/skills" + + with tempfile.TemporaryDirectory() as tmp: + written = config.write_default(Path(tmp) / "config.toml") + text = written.read_text() + assert "skills_enabled" in text + assert "skills_dir" in text + print("ok skills config") + + def test_provider_parsing(): """Providers come from [providers.*]; a bare base_url synthesizes local.""" from llamachat import providers @@ -3482,6 +3511,7 @@ if __name__ == "__main__": test_version_matches_changelog() test_venv_discovery() test_config_defaults() + test_skills_config() test_provider_parsing() test_provider_malformed_shapes() test_unusable_config_exits() -- cgit v1.2.3