fix(config): preserve Unicode in validation received values#109664
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 1:19 AM ET / 05:19 UTC. Summary PR surface: Source +1, Tests +11. Total +12 across 2 files. Reproducibility: yes. Current main’s raw UTF-16 slice and the supplied 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the shared-helper fix and focused regression test after refreshing the branch against current main and confirming the exact head passes required checks. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s raw UTF-16 slice and the supplied Is this the best way to solve the issue? Yes. Reusing the repository’s shared UTF-16-safe truncation helper at the existing cutoff is the narrowest maintainable fix and avoids introducing a parallel truncation implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5199bfafea6b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +11. Total +12 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
|
Co-authored-by: ZengWen-DT <[email protected]>
|
Merged via squash.
|
…#109664) * fix(config): preserve Unicode in validation received values * test: tighten config diagnostic truncation proof Co-authored-by: ZengWen-DT <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where users running
openclaw config validatecould see a replacement character (�) when an invalid received value was long enough for the diagnostic preview to truncate inside an emoji.Why This Change Was Made
The validation diagnostic now uses the shared UTF-16-safe truncation helper before appending its existing ellipsis. The 160-code-unit preview limit and all non-truncated output remain unchanged.
User Impact
Long invalid configuration values are still summarized, but their diagnostics no longer emit malformed Unicode when the cutoff lands inside a surrogate pair.
Evidence
openclaw config validatewith an invalidgateway.bindvalue of 155 ASCII characters followed by🎉tailemitted�in thegot:preview.0e9db600595: the same command exits 1 as expected, while an output probe reportsreplacementCharacter=falseandunpairedSurrogate=false.node scripts/run-vitest.mjs src/config/issue-location.test.ts— 54/54 passed../node_modules/.bin/oxfmt --check src/config/issue-location.ts src/config/issue-location.test.ts.git diff --checkpassed.AI-assisted: built with Codex.