Skip to content

fix(exec): preserve Unicode in retained process output tails - #104754

Merged
steipete merged 1 commit into
mainfrom
codex/takeover-104531
Jul 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/takeover-104531

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Long retained process output could be truncated through the middle of a UTF-16 surrogate pair. The streamed output remained correct, but the bounded stdout or stderr tail could end with a corrupted replacement character.

Supersedes #104531 because its fork does not allow maintainer writes.

Why This Change Was Made

The process supervisor now uses the normalization package's canonical UTF-16-safe slicing helper when retaining the bounded tail. The consolidated regression drives both stdout and stderr through the real supervisor path and proves the exact retained result at the boundary.

The final patch is one focused commit on current main; the original contributor remains the commit author.

User Impact

Before: a long child-process output tail could corrupt a boundary emoji in the retained result.

After: the incomplete surrogate pair is dropped while the truncation marker, size bound, and full streamed chunks remain unchanged.

Evidence

  • Changed: src/process/supervisor/supervisor.ts
  • Regression: src/process/supervisor/supervisor.test.ts
  • Prior sanitized AWS Crabbox on the identical patch: run_56c83697a6cb
  • Fresh autoreview on the reviewed patch: no findings, confidence 0.98
  • Targeted formatting and git diff --check: passed
  • Native exact-head prepare remains the merge gate

Real behavior proof

  • Behavior addressed: retained stdout and stderr tails no longer split UTF-16 surrogate pairs.

  • Reachability: child adapter output -> supervisor capture bound -> RunExit.stdout / RunExit.stderr.

  • Sibling coverage: the same helper path handles both streams; the regression proves both.

  • Fix classification: root-cause fix.

  • AI-assisted (Codex)

  • I understand what the code does

  • Change is focused and does not mix unrelated concerns

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 11, 2026
@steipete

steipete commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready maintainer proof:

  • Exact head: 8e26104fdfa584b617a3f8b3475b398e083dcca4; original fix(exec): long retained process output corrupts boundary emoji #104531 contributor remains the commit author.
  • Focused sanitized AWS Crabbox: run_56c83697a6cb on the identical patch.
  • Exact-head hosted CI: run 29170935533, green.
  • Fresh autoreview: no findings, confidence 0.98.
  • Repository-native review artifacts: validated with zero findings.
  • Repository-native prepare: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 104754; hosted exact-head gates passed and the remote PR tree matched the prepared tree.

This is the takeover for unpushable contributor PR #104531. The final one-commit patch uses the canonical UTF-16-safe slicing helper for both retained stdout and stderr tails and proves the exact boundary result.

Final state: #104531 landed concurrently as 2077ebe8b4065de6cccd8a25e40e04fe55afc4dc while this takeover was in the native merge flow. GitHub therefore recorded #104754 as the empty commit 50dd2db020589efafd13bc04139b28c3d3e9213e; the canonical behavior and contributor credit are in #104531's landed commit.

@steipete
steipete merged commit 50dd2db into main Jul 11, 2026
80 of 82 checks passed
@steipete
steipete deleted the codex/takeover-104531 branch July 11, 2026 22:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants