Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 12:32 PM ET / 16:32 UTC. Summary PR surface: Tests +18, Other +32. Total +50 across 6 files. Reproducibility: yes. from source: current Review metrics: 1 noteworthy metric.
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 findings
Review detailsBest possible solution: Keep one decoder implementation in Do we have a high-confidence way to reproduce the issue? Yes, from source: current Is this the best way to solve the issue? No, not as submitted: the inline decoder is a narrow fix, but the separate unused module and its Knip suppression are unnecessary duplicate machinery. The implementation should retain one owner and provide full-path runtime proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a626330a3bf8. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +18, Other +32. Total +50 across 6 files. View PR surface stats
Acceptance criteria:
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 (9 earlier review cycles; latest 8 shown)
|
2b2acbf to
01e4277
Compare
When formatter (oxfmt) error output on a generated TypeScript/JavaScript module exceeds the 16 KiB tail cap and the retained byte window starts inside a multibyte UTF-8 character, the diagnostic tail would begin with a replacement character (�). Add a decodeUtf8Tail helper that skips leading UTF-8 continuation bytes before decoding the byte suffix, matching the same pattern already addressed in scripts/run-additional-boundary-checks.mjs (openclaw#109167). Keep the existing 16 KiB cap and ASCII behavior unchanged.
01e4277 to
dd5acb6
Compare
|
Thank you for working on UTF-8-safe formatter diagnostics and for identifying the split-character boundary. Your broader original #110825 is now merged as 796ee27 and fixes this generated-module formatter through one shared helper, while also fixing the docs formatter and adding an end-to-end regression that runs an actual failing child process. Closing this narrower sibling as superseded keeps your original contribution and its stronger regression intact, without introducing an unused decoder or weakening the Knip dead-code audit. Thank you again for both contributions. |
What Problem This Solves
Fixes an issue where
scripts/lib/format-generated-module.mjscould render areplacement character (�) in failure diagnostics when a formatter
(oxfmt) error output on a generated TypeScript/JavaScript module exceeded the
16 KiB tail cap and the retained byte window started inside a multibyte UTF-8
character. For example, a code-generated module containing CJK string
literals or comments that tripped the formatter would produce a corrupted
first character in the diagnostic tail.
Why This Change Was Made
outputTailtook a byte-bounded suffix withbytes.subarray(-N).toString("utf8")before decoding, matching the samepattern already addressed in the sibling script
scripts/run-additional-boundary-checks.mjs(#109167). A newdecodeUtf8Tailhelper now skips any leading UTF-8 continuation bytes,keeping the existing 16 KiB cap unchanged.
User Impact
Generated-module formatting failure diagnostics stay readable when the capped
formatter output contains multibyte text at the retention boundary. There is
no behaviour change for ASCII-only output or output that stays within the
16 KiB budget.
Evidence
Before the fix,
node -econfirmed:After the fix, the same input produces
"好"— the single continuationbyte is skipped and the intact character follows.
node scripts/run-vitest.mjs test/scripts/format-generated-module.test.ts -- -t decodeUtf8passed with 3 tests (continuation-byte boundary skip, ASCII passthrough,
empty buffer).
oxfmt --checkpassed on both changed files.