Skip to content

Codex skill loader fails to detect valid YAML front matter in SKILL.md files saved as UTF-8 with BOM #13918

Open

Description

@mnikonov

What version of the IDE extension are you using?

26.304.20706

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When a local skill definition file named SKILL.md is saved as UTF-8 with BOM, Codex fails to load it even though the file contains valid YAML front matter delimited by ---.

The loader reports:

failed to load skill <redacted-path>\SKILL.md: missing YAML frontmatter delimited by ---

The file content is valid. The only difference is that the file begins with the UTF-8 BOM bytes EF BB BF before the opening ---.

This causes the skill to be skipped and not appear in the session’s available skills list.

What steps can reproduce the bug?

  1. Create a local skill file named SKILL.md.
  2. Put valid front matter at the top of the file:
---
name: example-skill
description: Example description
---

# PURPOSE

Example content.
  1. Save the file as UTF-8 with BOM.
  2. Start or reload the Codex session so skills are discovered.

Observed result:

  • the skill is not loaded
  • the loader reports:
failed to load skill <redacted-path>\SKILL.md: missing YAML frontmatter delimited by ---
  1. Save the exact same file as UTF-8 without BOM.
  2. Start or reload the session again.

Observed result:

  • the skill loads successfully

Byte-level difference at the beginning of the file:

UTF-8 with BOM:    EF BB BF 2D 2D 2D
UTF-8 without BOM: 2D 2D 2D

What is the expected behavior?

Codex should successfully load a valid SKILL.md file even if it is encoded as UTF-8 with BOM.

At minimum, the loader should either:

  • support UTF-8 BOM transparently, or
  • return an explicit error that BOM-prefixed files are unsupported

It should not report that YAML front matter is missing when valid front matter is present.

Additional information

This appears to be a parser/loader issue at the start-of-file boundary. The closing --- delimiter is normal and on its own line. The failure only occurs when the opening front matter delimiter is preceded by BOM bytes.

This is easy to trigger on Windows because some editors save Markdown/text files as UTF-8 with BOM by default.

The current error message is misleading and makes the problem difficult to diagnose.

Activity

  1. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    on Mar 7, 2026
  2. MovGP0 commented on Jun 25, 2026

    @MovGP0

    I can confirm. BOM handling seems to be broken; have the problem with SKILL.md files and whole-file / first line patching that is failing.

    codex-cli 0.142.0
    
  3. MovGP0 commented on Jun 26, 2026

    @MovGP0

    @etraut-openai Unfortunately I was unable to open a PR. Here is a patch file instead:

    0001-Adding-support-for-files-with-BOM-UTF-8-UTF-16-BE-LE.patch

    It fixes these bugs:

    #13918
    #28804

    What changed:

    • Added shared decode_text_with_bom in codex-utils-string.
    • Supports UTF-8, UTF-16 BE/LE, UTF-32 BE/LE, and GB18030 via existing encoding_rs.
    • Reports unsupported BOMs for UTF-7, UTF-1, UTF-EBCDIC, SCSU, and BOCU-1.
    • Applied decoding to SKILL.md, skill metadata JSON/YAML, plugin manifest JSON, and pet manifests.
    • Added BOM coverage for skill loading, JSON metadata, plugin JSON, pet JSON, and the decoder.
  4. jxu commented on Aug 11, 2026

    @jxu

    Same issue still using codex-cli 0.146.0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extensionskillsIssues related to skillswindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions