fix(qqbot): keep bounded previews UTF-16 safe#101516
Merged
Merged
Conversation
vincentkoc
marked this pull request as ready for review
July 7, 2026 09:05
Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>
vincentkoc
force-pushed
the
fix/qqbot-utf16-bounded-previews
branch
from
July 7, 2026 09:07
9591d3c to
b91775d
Compare
Member
Author
|
Land-ready at exact head b91775d. Validation:
The canonical diff keeps all existing caps, suffixes, empty/undefined behavior, and excludes parsing, protocol, IDs/hashes, cache keys, and fetch/SSRF-adjacent URL diagnostics. No remaining proof gaps for this rendering-only change. Contributor @wangmiao0668000666 is preserved as co-author. |
Member
Author
|
Merged via squash.
|
Contributor
|
Thanks for the consolidated fix and the credit — appreciate you carrying the follow-up scope ( Two notes from the contributor side that may help:
Happy to investigate any post-merge regressions in the qqbot log/error paths if they come up. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 8, 2026
Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>
giodl73-repo
pushed a commit
to giodl73-repo/openclaw
that referenced
this pull request
Jul 8, 2026
Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
QQBot still used raw string slices at 30 fixed-size log, diagnostic, API-error, and outbound preview sites. When a surrogate pair crossed a cap boundary, the result contained a lone UTF-16 surrogate that could not round-trip cleanly through JSON, terminals, or downstream renderers.
This consolidates and supersedes #101410, #101426, and #101444 while preserving contributor credit from @wangmiao0668000666.
Why This Change Was Made
The change replaces only bounded arbitrary-text preview slices with the existing
truncateUtf16Safehelper. Existing caps, suffixes, empty-string handling, andundefinedlogging semantics are unchanged.Structural parsing, array limits, hashes, IDs, timestamps, protocol chunks, cache keys, token parsing, and fetch/SSRF-adjacent URL diagnostics are intentionally excluded.
User Impact
QQBot errors, logs, command previews, message previews, and bounded outbound diagnostics no longer emit half of an emoji or another surrogate pair at an existing length cap. No configuration, network, transport, protocol, or message-routing behavior changes.
Evidence
tbx_01kwxwjxbyevbyqwfmgazbzs3y: 10 focused QQBot files, 118 tests passed.pnpm check:changedpassed extension typechecks, extension-test typechecks, lint, dependency guards, database-first guard, media helper guard, runtime sidecar guard, and import-cycle check.git diff --check: passed.Supersedes #101410
Supersedes #101426
Supersedes #101444