fix(skills): decode skill bodies as UTF-8 🤖🤖🤖 - #281
Conversation
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe skill loader now reads ChangesSkill file encoding
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to Skill bodies containing multilingual text and symbols now load as UTF-8 rather than depending on the host locale. The targeted regression coverage indicates no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
What does this PR do?
Skill metadata is read as UTF-8, but
_parse_skill_md()reads the body using the locale encoding. A UTF-8 skill containing50€ → café 中文 🚀becomes corrupted instructions on a cp1252 host. Read the body as UTF-8 too.Add a regression that forces a legacy default even on UTF-8 hosts and checks the loaded skill's full body. The test fails before the fix.
Related issues
The parser remains in use in #161; this change is limited to its body decoding and does not alter that refactor's APIs or arbitrary-file encoding policy.
Validation
uv run pytest -q tests/unit/test_skill.py -k 'not run_script'— 19 passed, 7 Bash-dependent tests deselected.Windows/Python 3.12 with external import-only helpers for #84/#85 (
fcntl/SIGUSR2). Helpers are not included; POSIX locks/signals and Bash execution are not validated by this run.Checklist
Summary by CodeRabbit
Bug Fixes
Tests