fix(oc-path): use truncateUtf16Safe for error message path truncation#102527
Conversation
Replace naive .slice(0, 80) with truncateUtf16Safe() at three error-reporting call sites to prevent surrogate pair splitting in oc:// path validation error messages. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 4:30 AM ET / 08:30 UTC. Summary PR surface: Source +1, Tests +37. Total +38 across 2 files. Reproducibility: yes. at source level: current main slices an overlong path context at UTF-16 code unit 80, and a prefix-plus-emoji probe shows that cut can leave a dangling high surrogate. I did not run the full oc-path test suite in this read-only review. Review metrics: none identified. 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: Keep the narrow SDK-helper parser fix with its regression tests, then merge only after redacted real behavior proof shows an overlong emoji-containing Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main slices an overlong path context at UTF-16 code unit 80, and a prefix-plus-emoji probe shows that cut can leave a dangling high surrogate. I did not run the full oc-path test suite in this read-only review. Is this the best way to solve the issue? Yes, the current PR is the best narrow fix: it reuses the existing UTF-16-safe helper through the plugin SDK facade and covers all three overlong oc-path error sites. A direct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 240d350c7f66. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +37. Total +38 across 2 files. 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
|
|
Land-ready maintainer verification at exact head
Tests assert structured |
|
Merged via squash.
|
…openclaw#102527) * fix(oc-path): use truncateUtf16Safe for error message path truncation Replace naive .slice(0, 80) with truncateUtf16Safe() at three error-reporting call sites to prevent surrogate pair splitting in oc:// path validation error messages. Co-Authored-By: Claude <[email protected]> * test(oc-path): cover utf16 error truncation --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
oc-path parser truncates error context strings with naive .slice(0, 80) at three fail() call sites, risking surrogate pair splitting in error messages.
Files Changed
🤖 Generated with Claude Code