Skip to content

fix(ci): keep boundary output tails UTF-8 safe - #109167

Merged
steipete merged 5 commits into
openclaw:mainfrom
qingminglong:codex/fix-additional-boundary-output-utf8
Jul 17, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
qingminglong:codex/fix-additional-boundary-output-utf8

Conversation

@qingminglong

@qingminglong qingminglong commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where CI additional boundary-check diagnostics could render replacement characters when byte-bounded subprocess output starts inside a multibyte UTF-8 character.

Why This Change Was Made

The boundary-check output buffer now drops leading UTF-8 continuation bytes after byte-tail trimming and decodes the retained bytes with StringDecoder. The change stays inside the additional boundary-check script output owner boundary and preserves the existing byte cap and truncation marker.

User Impact

CI failure output remains readable for multibyte subprocess diagnostics while still keeping noisy boundary-check logs bounded.

Evidence

  • Current head: 06758a37d19535321c39b86c81b831f57183b3ba after merge-refresh onto upstream/main 0903ebe4fa5f4643aaf83e3d59cc5518f80db448.
  • Focused regression: node scripts/run-vitest.mjs test/scripts/run-additional-boundary-checks.test.ts -- -t "drops split UTF-8" passed, 1 file / 2 selected tests.
  • Runtime helper transcript: node --input-type=module -e "import { createBoundedOutputBuffer } from './scripts/run-additional-boundary-checks.mjs'; ..." returned {"singleChunk":"[output truncated to last 5 bytes]\\nnew","bufferedOverflow":"[output truncated to last 5 bytes]\\nnew"} for old\u{1f600}new, without replacement characters.
  • Diff hygiene: git diff --check upstream/main...HEAD passed; diff is limited to scripts/run-additional-boundary-checks.mjs and test/scripts/run-additional-boundary-checks.test.ts.
  • Autoreview: python .agents\skills\autoreview\scripts\autoreview --mode branch --base upstream/main --codex-bin C:\Users\86158\.codex\codex-pixel-autoreview.cmd passed with autoreview clean: no accepted/actionable findings reported.
  • Duplicate search after refresh: gh search prs --repo openclaw/openclaw "run-additional-boundary-checks createBoundedOutputBuffer additional boundary UTF-8" returned only this PR.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 1:37 PM ET / 17:37 UTC.

Summary
The PR makes byte-trimmed CI boundary-check output decode as valid UTF-8 and adds regression tests for both truncation paths.

PR surface: Tests +15, Other +9. Total +24 across 2 files.

Reproducibility: yes. at source level: retaining five bytes from old😀new begins on UTF-8 continuation bytes, and the supplied direct helper run exercises both affected truncation branches.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The reviewed head is behind current main, so the exact merge head should receive the normal refreshed checks; no concrete three-way merge regression is currently shown.

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared UTF-8-safe tail decoder with both regression cases once the exact merge head is current and green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the remaining action is ordinary maintainer review with exact-head merge gating.

Security
Cleared: The diff only changes in-memory CI output decoding and tests, without adding dependencies, permissions, secrets, downloads, lifecycle hooks, or execution sources.

Review details

Best possible solution:

Land the shared UTF-8-safe tail decoder with both regression cases once the exact merge head is current and green.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: retaining five bytes from old😀new begins on UTF-8 continuation bytes, and the supplied direct helper run exercises both affected truncation branches.

Is this the best way to solve the issue?

Yes; fixing the shared bounded-output owner is narrower and more maintainable than special-casing individual boundary checks while preserving the existing byte cap and truncation marker.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b6e90cbed4c2.

Label changes

Label changes:

  • add P3: This is a low-blast-radius CI diagnostic readability fix rather than a product runtime regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Copied terminal output directly exercises the exported after-fix helper for both truncation paths and shows readable bounded output without replacement characters.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Copied terminal output directly exercises the exported after-fix helper for both truncation paths and shows readable bounded output without replacement characters.

Label justifications:

  • P3: This is a low-blast-radius CI diagnostic readability fix rather than a product runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Copied terminal output directly exercises the exported after-fix helper for both truncation paths and shows readable bounded output without replacement characters.
  • proof: sufficient: Contributor real behavior proof is sufficient. Copied terminal output directly exercises the exported after-fix helper for both truncation paths and shows readable bounded output without replacement characters.
Evidence reviewed

PR surface:

Tests +15, Other +9. Total +24 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 11 2 +9
Total 2 26 2 +24

What I checked:

Likely related people:

  • steipete: Recent merged history shows repeated work on CI and repository-script behavior; exact file-level provenance could not be recovered, so this is a low-confidence routing candidate. (role: adjacent CI and scripts contributor; confidence: low; commits: 6fb74d4; files: scripts/run-additional-boundary-checks.mjs, test/scripts/run-additional-boundary-checks.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-16T16:54:39.674Z sha 06758a3 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 16, 2026
@steipete
steipete merged commit f3e8164 into openclaw:main Jul 17, 2026
108 of 110 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
* fix(ci): keep boundary output tails UTF-8 safe

* fix(ci): preserve split UTF-8 output tails

Co-authored-by: qingminlong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
wings1029 added a commit to wings1029/openclaw that referenced this pull request Jul 19, 2026
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.
steipete pushed a commit to wings1029/openclaw that referenced this pull request Jul 20, 2026
When formatter (oxfmt) error output 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 existing pattern in
scripts/run-additional-boundary-checks.mjs (openclaw#109167).

Keep the existing 16 KiB cap and ASCII behavior unchanged.
steipete added a commit that referenced this pull request Jul 29, 2026
* fix(scripts): keep format-docs output tails UTF-8 safe

When formatter (oxfmt) error output 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 existing pattern in
scripts/run-additional-boundary-checks.mjs (#109167).

Keep the existing 16 KiB cap and ASCII behavior unchanged.

* refactor(scripts): share UTF-8-safe output tails

Co-authored-by: 陈志强0668000989 <[email protected]>

* test(scripts): prove real formatter UTF-8 failures

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* fix(scripts): keep format-docs output tails UTF-8 safe

When formatter (oxfmt) error output 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 existing pattern in
scripts/run-additional-boundary-checks.mjs (openclaw#109167).

Keep the existing 16 KiB cap and ASCII behavior unchanged.

* refactor(scripts): share UTF-8-safe output tails

Co-authored-by: 陈志强0668000989 <[email protected]>

* test(scripts): prove real formatter UTF-8 failures

---------

Co-authored-by: Peter Steinberger <[email protected]>
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* fix(ci): keep boundary output tails UTF-8 safe

* fix(ci): preserve split UTF-8 output tails

Co-authored-by: qingminlong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants