Skip to content

fix(telegram): render full clarify choice text in message body (closes #27497)#28475

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-6063e704
May 19, 2026
Merged

fix(telegram): render full clarify choice text in message body (closes #27497)#28475
teknium1 merged 2 commits into
mainfrom
hermes/hermes-6063e704

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #27852 (@asdlem).

Summary

Telegram mobile truncates inline button labels, making long clarify options unreadable. This fix renders the full numbered choice list in the message body and uses short numeric button labels ("1", "2", …) instead of "{n}. {label}", so the full option text is always visible.

Changes

  • gateway/platforms/telegram.py::send_clarify: append 1. <choice1>\n2. <choice2> to message body (HTML-escaped); buttons keep short numeric labels. "✏️ Other (type answer)" button preserved.
  • tests/gateway/test_telegram_clarify_buttons.py: renamed truncation test → test_long_choice_rendered_in_body_not_truncated; verifies full long-choice text appears in kwargs['text'].

Validation

  • scripts/run_tests.sh tests/gateway/test_telegram_clarify_buttons.py -q → 12/12 passing.

Authorship preserved via cherry-pick. Closes #27497.

Also supersedes #27535 (@luyao618) and #27581 (@yahyasaqban-lab) which proposed functionally identical fixes — both closed with credit.

asdlem and others added 2 commits May 18, 2026 21:48
…hort button labels

When Telegram clarify prompts offer long choices, mobile clients
truncate the inline button labels, making options unreadable.
Previously only the question was shown in the message body with
truncated choice text in button labels.

Fix: append the full numbered option list to the message body
so users can read complete choice text on any client.  Buttons
now use short numeric labels (1, 2, ...) to avoid Telegram
truncation.  The 'Other (type answer)' button is unchanged.

Long choice labels are now rendered in full (not truncated to
57 chars + '...') since they appear in the body instead of
button labels.

Closes: #27497
@teknium1 teknium1 merged commit ab11d09 into main May 19, 2026
13 of 17 checks passed
@teknium1 teknium1 deleted the hermes/hermes-6063e704 branch May 19, 2026 04:49
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-6063e704 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8876 on HEAD, 8876 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4647 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter P2 Medium — degraded but workaround exists labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram clarify choices should include full numbered text when buttons truncate

3 participants