fix(auto-reply,infra): keep startup context and heartbeat event text UTF-16 safe#102483
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 3:08 AM ET / 07:08 UTC. Summary PR surface: Source +2, Tests +38. Total +40 across 4 files. Reproducibility: yes. source inspection gives a high-confidence current-main reproduction path: call the affected truncation functions with content whose cutoff lands between a surrogate pair, and raw 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 narrow helper-based fix after the contributor adds real behavior proof showing a long startup memory or heartbeat exec-output truncation with emoji stays well-formed, or after a maintainer explicitly overrides the proof gate. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence current-main reproduction path: call the affected truncation functions with content whose cutoff lands between a surrogate pair, and raw Is this the best way to solve the issue? Yes, this is the narrowest maintainable fix shape: use the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4fa3118049c1. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2, Tests +38. Total +40 across 4 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 at exact head Improvements made during review:
Proof:
No known proof gaps. |
|
Merged via squash.
|
…UTF-16 safe (openclaw#102483) * fix(auto-reply,infra): keep startup context and heartbeat event text UTF-16 safe * test: strengthen UTF-16 truncation coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
trimStartupMemoryContent()instartup-context.tsandbuildExecEventPrompt()inheartbeat-events-filter.tsuse rawString.prototype.slice()to truncate text. This can split emoji surrogate pairs, producing broken�in startup memory context (MEMORY.md content) and async command output relayed via heartbeat events.Why This Change Was Made
These two functions truncate user-authored content that may contain emoji — startup memory files and async exec command output. They now use
truncateUtf16Safefrom@openclaw/normalization-core/utf16-slice.User Impact
Evidence
startup-context.test.ts— verifying truncation with emoji contentheartbeat-events-filter.test.ts— verifying long event text with emoji stays intact🤖 Generated with Claude Code