Skip to content

fix(skills): strip UTF-8 BOM before parsing frontmatter - #4563

Closed
Solaris-star wants to merge 1 commit into
PrefectHQ:mainfrom
Solaris-star:fix/4532-skill-utf8-bom
Closed

Solaris-star wants to merge 1 commit into
PrefectHQ:mainfrom
Solaris-star:fix/4532-skill-utf8-bom

Conversation

@Solaris-star

Copy link
Copy Markdown

Summary

SKILL.md files saved as UTF-8 with a BOM were discovered as skills but lost their frontmatter: description became the literal "\ufeff---" and frontmatter was {}.

Change

  • Strip a leading UTF-8 BOM in parse_frontmatter before looking for ---
  • Add a unit test covering the BOM case

Test plan

  • Manual: parse_frontmatter("\ufeff---\\nname: bom-skill\\n...") returns the expected dict
  • CI skills provider tests

Fixes #4532.

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.
@github-actions

Copy link
Copy Markdown
Contributor

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:

  1. If you opened the linked issue, a maintainer will assign you when they pick it up and this PR reopens automatically. If someone else opened it, the PR reopens only if a maintainer chooses to assign it to you — please don't comment to ask.

Once you're assigned and the link is present, this PR reopens automatically — no further action needed.

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

@github-actions github-actions Bot closed this Jul 20, 2026
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. low-priority server Related to FastMCP server implementation or server-side functionality. labels Jul 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +51 to 52
assert body.startswith("# BOM Skill")
assert body.strip().startswith("# Skill Content")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Solaris-star

Copy link
Copy Markdown
Author

Reopening context: this fixes #4532 (UTF-8 BOM breaks skill frontmatter parsing). Happy to adjust if the assignment gate requires claiming the issue first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. missing-issue-link server Related to FastMCP server implementation or server-side functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills with a UTF-8 BOM lose their frontmatter metadata

1 participant