fix(migrate-claude): use truncateUtf16Safe for skill description truncation#102616
Conversation
…cation One .slice(0, 180) truncation site in the migrate-claude extension may cut UTF-16 surrogate pairs in half when the skill description contains multi-byte characters such as emoji. Replace it with truncateUtf16Safe to keep the truncated output valid Unicode.
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 6:41 AM ET / 10:41 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. from source inspection and a read-only Node probe: current main's Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical PR after redacted real migrate-claude output or a generated Do we have a high-confidence way to reproduce the issue? Yes from source inspection and a read-only Node probe: current main's Is this the best way to solve the issue? Yes at the code level: reusing the exported plugin SDK AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c87b9a7cee90. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
…cation (openclaw#102616) * fix(migrate-claude): use truncateUtf16Safe for skill description truncation One .slice(0, 180) truncation site in the migrate-claude extension may cut UTF-16 surrogate pairs in half when the skill description contains multi-byte characters such as emoji. Replace it with truncateUtf16Safe to keep the truncated output valid Unicode. * test(migrate-claude): cover UTF-16 skill description --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Claude command migration generates a YAML
descriptionfrom the command's first paragraph. A raw 180-unit UTF-16 slice could leave a dangling surrogate, producing malformed generated skill metadata when an emoji crossed the boundary.Why This Change Was Made
Use the shared public plugin-SDK truncation primitive at the existing 180-unit bound. Source discovery, paragraph normalization, JSON/YAML quoting, and the imported command body are unchanged.
User Impact
Generated skills from long Claude commands retain valid Unicode metadata. The existing description size and all ASCII output remain unchanged.
Evidence
SKILL.mdand asserts its description line at the surrogate boundary.oxfmt,oxlint, andgit diff --checkpassed.Generated with Claude Code; reviewed and improved by an OpenClaw maintainer agent.