Repository navigation
fix(skills): strip UTF-8 BOM before parsing frontmatter - #4563
Solaris-star wants to merge 1 commit into
Conversation
YAML 1.2 allows a BOM at the start of a character stream; Windows editors still emit one. Without stripping, the opening --- is not recognized and the skill description becomes the literal BOM+delimiter. Fixes #4532.
|
Don't open a new pull request — this one reopens on its own. It's closed for now because you aren't assigned to the issue it references, but the moment that's fixed it reopens automatically. Keep this PR and edit it; opening a fresh duplicate just starts you over and creates more to triage. Per CONTRIBUTING.md, an external PR must reference an issue that's assigned to its author. To get there:
Once you're assigned and the link is present, this PR reopens automatically — no further action needed. Maintainers: reopen this PR or remove the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83cba58484
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| assert body.startswith("# BOM Skill") | ||
| assert body.strip().startswith("# Skill Content") |
There was a problem hiding this comment.
Move the body assertion back to the basic test
This new BOM test now contains contradictory expectations: the BOM content's body starts with # BOM Skill, but the next assertion still requires it to start with # Skill Content. With the fixture defined in this test, TestParseFrontmatter::test_frontmatter_with_utf8_bom will fail deterministically and block CI until the old assertion is moved back to test_basic_frontmatter or updated for the BOM case.
Useful? React with 👍 / 👎.
|
Reopening context: this fixes #4532 (UTF-8 BOM breaks skill frontmatter parsing). Happy to adjust if the assignment gate requires claiming the issue first. |
Summary
SKILL.mdfiles saved as UTF-8 with a BOM were discovered as skills but lost their frontmatter: description became the literal"\ufeff---"andfrontmatterwas{}.Change
parse_frontmatterbefore looking for---Test plan
parse_frontmatter("\ufeff---\\nname: bom-skill\\n...")returns the expected dictFixes #4532.