Skip to content

fix(skills): read skill markdown as UTF-8 - #4995

Open
JieZeng777 wants to merge 1 commit into
bytedance:mainfrom
JieZeng777:codex/fix-skill-validator-utf8
Open

fix(skills): read skill markdown as UTF-8#4995
JieZeng777 wants to merge 1 commit into
bytedance:mainfrom
JieZeng777:codex/fix-skill-validator-utf8

Conversation

@JieZeng777

Copy link
Copy Markdown

Why

On Windows systems whose default locale is not UTF-8, the skill creator validator reads SKILL.md with the platform default encoding. Localized UTF-8 skills can therefore fail validation with UnicodeDecodeError, even though the skill file itself is valid.

What changed

  • Read SKILL.md explicitly as UTF-8 in the skill creator validator.
  • Add a portable regression test that simulates a non-UTF-8 Windows default code page.
  • Document the UTF-8 contract for skill text resources and validation utilities.

Surface area

  • Frontend UI — page / component / setting / interaction under frontend/
  • Backend API — endpoint / SSE event / request-response shape under backend/app
  • Agents / LangGraph — agent node, graph wiring, langgraph.json, or prompt change
  • Sandboxdocker/ or sandboxed execution
  • Skills — change under skills/
  • Dependencies — new/upgraded entry in backend/pyproject.toml or frontend/package.json
  • Default behavior change — changes existing behavior without the user opting in
  • Docs / tests / CI only — no runtime behavior change

Screenshots / Recording

Not applicable; this change has no UI surface.

Bug fix verification

  • Test path that reproduces the bug: tests/skills/test_skill_creator_quick_validate.py
  • Did it go red on main and green on this branch? Yes. Before the fix, the regression test raised the simulated GBK UnicodeDecodeError; after the fix, it passes.

Validation

  • python -m pytest tests/skills -q — 52 passed
  • python -m ruff check --config backend/ruff.toml tests/skills/test_skill_creator_quick_validate.py — passed
  • python -m ruff format --check --config backend/ruff.toml tests/skills/test_skill_creator_quick_validate.py — passed
  • python skills/public/skill-creator/scripts/quick_validate.py skills/public/skill-creator — Skill is valid

AI assistance

Tool(s) used: Codex

How you used it: Codex helped inspect the Windows locale failure, write the regression test, implement the minimal encoding fix, update documentation, and run validation. I reviewed and understand the resulting change.

  • I've read and understand every line of this change and take responsibility for it — it's not unreviewed AI output.

@CLAassistant

CLAassistant commented Aug 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added area:docs Documentation and Markdown only area:skills Skills under skills/ or the skills harness risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines labels Aug 24, 2026
@JieZeng777
JieZeng777 force-pushed the codex/fix-skill-validator-utf8 branch from 19c731d to 6e9e48f Compare August 24, 2026 07:04
@WillemJiang

Copy link
Copy Markdown
Collaborator

@JieZeng777 thanks for your contribution. Please click the CLA assitant button to sign the CLA first.

@JieZeng777

Copy link
Copy Markdown
Author

@WillemJiang Thanks! I’ve signed the CLA, and the license/cla check is now passing.

I also investigated the failing Skill Review CI. The four reported errors come from existing files in the skill-creator package and are unrelated to this PR’s UTF-8 change. This PR only changes quick_validate.py, but the CI reviews the entire package. Would you prefer that these pre-existing findings be handled separately, or should I include a narrowly scoped cleanup in this PR?

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

Labels

area:docs Documentation and Markdown only area:skills Skills under skills/ or the skills harness risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants