Repository navigation
fix(telegram): preserve UTF-16 model labels - #104037
Merged
Merged
Conversation
Contributor
Author
|
Land-ready proof for exact head
The fix reuses the existing public UTF-16-safe SDK primitive, removes the raw suffix slice, and covers both fallback model IDs and configured display names. |
Contributor
Author
|
Merged via squash.
|
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
Telegram's model picker preserves the tail of model button labels by slicing at 38 UTF-16 code units. When that suffix boundary falls between an emoji's surrogate halves, the button text contains an unpaired surrogate and renders as a replacement character.
This affects both fallback model IDs and configured model display names. The open callback-data PRs #98230 and #98694 change model selection encoding, but do not repair this independent label-rendering boundary.
Why This Change Was Made
Use the existing public
sliceUtf16Safeplugin SDK helper for the suffix operation, while retaining the existing 38-code-unit display budget and tail-preserving behavior. Rename the local helper around its actual input, centralize the label limit, and cover both label sources.User Impact
Long Telegram model labels no longer contain a broken replacement character when truncation lands inside an emoji. Short labels and the existing ellipsis-plus-suffix presentation remain unchanged.
Evidence
tbx_01kx7a49qv2xqp9yt3dbrt1mmh:pnpm test extensions/telegram/src/model-buttons.test.ts— 27/27 tests passed.check:changedfor both touched files — extension production/test type checks, lint, import-cycle checks, and repository guards passed.git diff --checkpassed.The path-scoped check emitted only the unrelated warning-only temporary-directory migration report already present on current
main.