fix(launchd): use truncateUtf16Safe for daemon output truncation#102669
fix(launchd): use truncateUtf16Safe for daemon output truncation#102669Pandah97 wants to merge 1 commit into
Conversation
Replace .slice(0, 1000) with truncateUtf16Safe() to prevent UTF-16 surrogate pair corruption in LaunchAgent command output.
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 6:45 AM ET / 10:45 UTC. Summary PR surface: Source +3. Total +3 across 1 file. Reproducibility: yes. from source inspection, but not from a live run. Current main uses 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: Land the localized helper substitution after redacted real launchd or terminal proof is added, or after a maintainer explicitly overrides the proof gate for this tiny daemon-output fix. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, but not from a live run. Current main uses Is this the best way to solve the issue? Yes. Replacing only the final truncation step is the narrow maintainable fix because it preserves the existing sanitization, whitespace normalization, caller behavior, and length cap while using the repository's shared tested helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 201acd4e7a4a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +3. Total +3 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
|
Summary
launchd.tstruncates daemon command output with.slice(0, 1000), which can split UTF-16 surrogate pairs when the output contains emoji or other multi-codepoint characters..slice(0, 1000)withtruncateUtf16Safe(value, 1000)— a guarded slice that preserves surrogate pair integrity.@openclaw/normalization-core/utf16-slice.Real behavior proof
pnpm tsgo:coretype check passes.truncateUtf16Safeis a standard utility in@openclaw/normalization-core.pnpm tsgo:coreconfirms compilation. The substitution is a direct 1:1 replacement at a single call site.truncateUtf16Safeis already used in 20+ merged PRs across the codebase.Risk checklist
truncateUtf16Safehas standalone unit tests innormalization-core. Zero behavioral change for ASCII/BMP text paths.AI-assisted
This PR was generated with Claude Code.