fix(qa-lab): keep capture preview truncation UTF-16 safe#102715
fix(qa-lab): keep capture preview truncation UTF-16 safe#102715cxbAsDev wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 8:28 AM ET / 12:28 UTC. Summary PR surface: Source +25, Tests +31. Total +56 across 2 files. Reproducibility: yes. Current main's 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:
Next step before merge
Security Review detailsBest possible solution: Land this browser-safe truncation fix at the QA Lab web boundary with normal exact-head merge gates; a later shared utility can be considered only if it stays dependency-free for browser bundles. Do we have a high-confidence way to reproduce the issue? Yes. Current main's Is this the best way to solve the issue? Yes. The PR fixes the affected QA Lab web rendering boundary, avoids the prior plugin SDK/browser-bundle import problem, and adds focused regression tests for both truncation edges. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 053567908316. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +25, Tests +31. Total +56 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
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review Addressed the browser-bundle import concern: Added real-behavior proof: |
|
🦞🧹 I asked ClawSweeper to review this item again. |
06058a7 to
ed3cb8b
Compare
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
@clawsweeper re-review Addressed the browser-bundle import concern without touching plugin SDK core:
PR body and evidence section are updated with the new build output. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
ed3cb8b to
46dccee
Compare
46dccee to
4ae40f2
Compare
|
@clawsweeper re-review Fixed the CI failures and addressed the browser-bundle concern without adding dependencies or touching plugin SDK core:
PR body is updated with the latest build output and verification commands. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Fixes an unsafe UTF-16 truncation in the QA Lab web UI capture preview path.
What Problem This Solves
extensions/qa-lab/web/src/ui-render.tstruncates long captured scalar values for display using raw.slice(0, 280)for the head and.slice(-80)for the tail. If the captured text contains a supplementary Unicode character (e.g. an emoji) that straddles either boundary, the preview ends up with a dangling surrogate half.Why This Change Was Made
Replaced the two raw
.slice()calls with a localsliceUtf16Safehelper that mirrors the implementation in@openclaw/normalization-core/utf16-slice. Keeping the helper local avoids importing any plugin SDK barrel into the QA Lab web bundle, so no Node.js built-ins are pulled into the Vite browser build. The scalar redactor is exported so the regression tests can exercise the exact truncation path without rendering the full UI.User Impact
QA Lab capture previews remain valid and readable when captured request/response bodies or fields contain emoji or other non-BMP characters.
Evidence
node scripts/run-vitest.mjs extensions/qa-lab/web/src/ui-render.test.ts --runpasses (9/9 tests).git diff --checkpasses.pnpm exec oxfmt --checkpasses for the touched files.node scripts/plugin-sdk-surface-report.mjs --checkpasses (no plugin SDK surface budget change).pnpm qa:lab:buildcompletes successfully after the change and produces a smaller bundle: