Skip to content

fix(text): keep bounded outputs UTF-16 safe#101355

Merged
vincentkoc merged 1 commit into
mainfrom
fix/canonical-utf16-boundaries
Jul 7, 2026
Merged

fix(text): keep bounded outputs UTF-16 safe#101355
vincentkoc merged 1 commit into
mainfrom
fix/canonical-utf16-boundaries

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #101297, #101299, #101300, #101301, #101302, #101305, #101306, #101308, #101309

What Problem This Solves

Fixes an issue where bounded text outputs could end with an unpaired UTF-16 surrogate when an emoji or other astral character crossed the truncation boundary. Affected outputs included extracted web text, media-understanding output, TTS/status text, transport diagnostics, and voice-call logs.

Why This Change Was Made

This consolidates nine overlapping contributor PRs into one canonical change using the existing truncateUtf16Safe helper at each non-security boundary. Prompt/session paths and guarded-fetch/SSRF-adjacent changes were deliberately excluded.

User Impact

Truncated output remains valid text instead of producing replacement characters, malformed JSON/log content, or broken downstream speech and transport handling.

Evidence

  • Before fix: focused base run reproduced lone-surrogate failures in web-fetch-utils and TTS status truncation.
  • tbx_01kwxc8jfxq8rtj3t320wfsnwp: exact 18-file pnpm check:changed passed all core/extension typecheck, lint, import-cycle, storage, media, runtime-loader, webhook, and pairing guards.
  • tbx_01kwxc8jfxq8rtj3t320wfsnwp: 142 focused tests passed across 9 files and 6 Vitest shards.
  • Fresh Codex autoreview: no accepted or actionable findings.

@vincentkoc vincentkoc self-assigned this Jul 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call agents Agent runtime and tooling size: M labels Jul 7, 2026
@vincentkoc vincentkoc added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jul 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready verification completed for exact head cfef7ebc1baf3ced8e14eb976bc0f50439e9aabf.

Proof:

  • Before fix: focused base tests reproduced lone-surrogate truncation failures in web-fetch output and TTS status detail.
  • Testbox tbx_01kwxc8jfxq8rtj3t320wfsnwp: corepack pnpm check:changed -- <18 changed files> passed all selected core/extension typecheck, lint, import-cycle, storage, media, runtime-loader, webhook, and pairing guards.
  • Same Testbox: node scripts/run-vitest.mjs <9 focused test files> passed 142 tests across 6 Vitest shards.
  • Hosted exact-head CI run 28841348302 completed successfully with zero failed jobs.
  • Fresh Codex autoreview reported no accepted or actionable findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 101355 passed the repository exact-head landing gates.

Known proof gaps: none for the changed bounded-text surfaces. Prompt/session and guarded-fetch/SSRF-adjacent fragments were intentionally excluded from this PR.

@vincentkoc vincentkoc added the clawsweeper:merge-ready ClawSweeper found the PR merge-ready but a human gate is still closed label Jul 7, 2026
@vincentkoc
vincentkoc merged commit 84e5327 into main Jul 7, 2026
165 of 169 checks passed
@vincentkoc
vincentkoc deleted the fix/canonical-utf16-boundaries branch July 7, 2026 04:33
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call clawsweeper:merge-ready ClawSweeper found the PR merge-ready but a human gate is still closed maintainer Maintainer-authored PR rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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.

1 participant