fix(kimi): preserve non-UTF-8 user skills (#3895)

Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Marsel Safin
2026-08-03 13:11:19 -05:00
committed by GitHub
co-authored by Copilot
parent 14fab0a1af
commit b69147c841
2 changed files with 19 additions and 1 deletions
@@ -317,7 +317,7 @@ def _is_speckit_generated_skill(skill_dir: Path) -> bool:
try:
content = skill_file.read_text(encoding="utf-8")
except OSError:
except (OSError, UnicodeError):
return False
if not content.startswith("---"):
@@ -199,6 +199,24 @@ class TestKimiTeardownLegacyCleanup:
assert user_skill.exists()
def test_teardown_preserves_non_utf8_user_skill(self, tmp_path):
i = get_integration("kimi")
user_skill = (
tmp_path
/ ".kimi"
/ "skills"
/ "speckit-user-owned"
/ "SKILL.md"
)
user_skill.parent.mkdir(parents=True)
user_skill.write_bytes(b"\xff\xfe")
m = IntegrationManifest("kimi", tmp_path)
i.teardown(tmp_path, m)
assert user_skill.read_bytes() == b"\xff\xfe"
class TestKimiCommandInvocation:
"""Kimi dispatch must use the native ``/skill:`` slash command."""