fix(qa-lab): use truncateUtf16Safe for CLI error message truncation#102671
fix(qa-lab): use truncateUtf16Safe for CLI error message truncation#102671Pandah97 wants to merge 1 commit into
Conversation
Replace .slice(0, 240) with truncateUtf16Safe() to prevent UTF-16 surrogate pair corruption in QA CLI error messages.
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 6:46 AM ET / 10:46 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. from source inspection: 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: Merge this code shape after the contributor adds redacted terminal/live output showing the qa-lab non-JSON stdout error path preserves surrogate pairs at the truncation boundary. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main uses Is this the best way to solve the issue? Yes for the code shape: using the existing public SDK AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5154fe08fa0b. Label changesLabel changes:
Label 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
|
Summary
suite-runtime-agent-process.tsin qa-lab extension truncates CLI stdout in error messages with.slice(0, 240), which can split UTF-16 surrogate pairs when the output contains emoji or other multi-codepoint characters..slice(0, 240)withtruncateUtf16Safe(text, 240)— a guarded slice that preserves surrogate pair integrity.parseQaCliJsonOutputerror path + added import fromopenclaw/plugin-sdk/text-utility-runtime.Real behavior proof
pnpm tsgo:coretype check passes.truncateUtf16Safeis a standard utility inopenclaw/plugin-sdk.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 and in sibling extensions.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.