fix(twitch): preserve UTF-16 pairs in outbound chunks#104030
Merged
Conversation
Contributor
Author
|
Land-ready proof for exact head
The resulting path is single-owner: markdown normalization plans safe chunks, every transport send passes through the manager, and the monitor fallback no longer bypasses that invariant. |
Contributor
Author
|
Merged via squash.
|
This was referenced Jul 11, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 11, 2026
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
Twitch outbound text had two raw UTF-16 splitters. OpenClaw's markdown-aware planner could bisect an emoji at its 500-unit hard boundary, and the Twurple 8.1.4
ChatClient.say()fallback uses the same unsafe raw slicing when a caller sends more than 500 units.Why This Change Was Made
Reuse the public surrogate-safe outbound chunker in both places that own the invariant:
TwitchClientManager.sendMessagepre-chunks every transport send before Twurple receives it.The monitor fallback now routes through that canonical manager path instead of calling
ChatClient.say()directly. A single Twitch limit constant keeps adapter metadata and transport enforcement aligned.User Impact
Emoji and other supplementary-plane characters remain intact when Twitch replies cross the 500-unit boundary. Chunk order is deterministic, and all normal outbound, message-adapter, direct internal, and inbound-reply fallback sends share the same transport guard.
Evidence
@twurple/chat8.1.4ChatClient.say()delegates tosplitOnSpaces(text, 500), whose hard fallback uses rawslice().tbx_01kx7a49qv2xqp9yt3dbrt1mmh: three focused Twitch suites — 44/44 passed.pnpm check:changed— extension production/test typechecks, lint, import-cycle, and repository guards passed.git diff --checkpassed.