fix(browser): keep UTF-8 stderr tails valid#102543
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 5:28 AM ET / 09:28 UTC. Summary PR surface: Source +1, Tests +18. Total +19 across 2 files. Reproducibility: yes. from source and a focused Node probe: current main decodes the retained tail with Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 the narrow shared-helper fix after normal exact-head merge and CI gating, keeping browser diagnostics byte-bounded and valid UTF-8 for both managed Chrome and Chrome MCP stderr consumers. Do we have a high-confidence way to reproduce the issue? Yes, from source and a focused Node probe: current main decodes the retained tail with Is this the best way to solve the issue? Yes. Using Node AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4ad94febcb31. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +18. Total +19 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 |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Land-ready review complete.
Proceeding through the repository-native exact-head prepare and merge guards. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users reading browser Chrome launch diagnostics could see Unicode replacement characters when the bounded stderr tail retained only part of a multibyte UTF-8 character.
Why This Change Was Made
The browser plugin already trims leading continuation bytes after byte-bounded truncation. This keeps the same UTF-8 boundary invariant for trailing partial code points by decoding the retained tail with Node's
StringDecoder, without changing Chrome launch or stderr collection behavior.User Impact
Browser startup diagnostics remain valid UTF-8 after byte truncation or split stream chunks, so the displayed stderr tail is cleaner and less misleading.
Evidence
f2caf55a2f13dfffdb3dff793a5c05e22c47af45:node scripts/run-vitest.mjs extensions/browser/src/browser/bounded-utf8-tail.test.tspassed (1 file, 6 tests).f2caf55a2f13dfffdb3dff793a5c05e22c47af45:node --import tsx -e "..."calleddecodeChromeMcpStderrTailwith a stderr buffer ending in an incomplete UTF-8 code point and passed with{"decoded":"chrome-mcp stderr tail:","replacementChar":false}.git diff --check upstream/main...HEADpassed.CI / build-artifactspassed onf2caf55a2f13dfffdb3dff793a5c05e22c47af45.python .agents\skills\autoreview\scripts\autoreview --mode branch --base upstream/mainpassed with no accepted/actionable findings.\u{1f600}byte sequence decodes only after all bytes are appended.