mirror of
https://github.com/github/spec-kit.git
synced 2026-08-15 14:02:04 +02:00
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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user