fix(memory-host): use truncateUtf16Safe for QMD stderr context truncation#102547
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 4:49 AM ET / 08:49 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. source inspection plus a focused Node check shows the current 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 helper change, add focused parser coverage for the stderr boundary, and require redacted terminal/log proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, source inspection plus a focused Node check shows the current Is this the best way to solve the issue? Yes, using the existing shared AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ccdb60e5db57. 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
|
|
Land-ready at exact head Maintainer fixup added exported-parser regression coverage for an emoji crossing the 117-code-unit QMD stderr boundary. Focused proof: Best-fix verdict: this keeps the existing parser-owned size policy and routes it through the shared UTF-16-safe primitive; no broader parser or error-contract change is needed. |
|
Merged via squash.
|
…tion (openclaw#102547) * fix(memory-host): use truncateUtf16Safe for QMD stderr context truncation * test(memory): cover UTF-16-safe qmd stderr summary --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
QMD stderr excerpts were truncated with a raw UTF-16 slice. When the cutoff landed between an emoji's surrogate halves, the resulting error text contained an unpaired surrogate.
Why This Change Was Made
Use the repository's existing
truncateUtf16Safeboundary helper at the QMD parser's owned stderr limit, preserving the same maximum and suffix while keeping output valid Unicode.User Impact
QMD parse errors remain readable when stderr contains emoji or other supplementary Unicode characters at the truncation boundary.
Evidence
node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/qmd-query-parser.test.ts— 9 tests passed.Files Changed
packages/memory-host-sdk/src/host/qmd-query-parser.tstruncateUtf16Safe.packages/memory-host-sdk/src/host/qmd-query-parser.test.ts🤖 Generated with Claude Code