Repository navigation
fix(telegram): avoid repeating native choices in message text - #140108
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 8:58 AM ET / 12:58 UTC. ClawSweeper reviewWhat this changesTelegram replies replace duplicated fallback choices with native buttons while retaining complete labels for choices that cannot become buttons. Merge readiness✅ Ready for maintainer review Keep open: the fix remains useful on current main, and the reviewed patch has no blocking correctness findings. The maintainer-protected PR is not a cleanup candidate. Priority: P2 Review scores
Verification
How this fits togetherTelegram’s presentation adapter converts shared reply content into message text and inline keyboards. Both outbound sends and agent replies use this adapter before Telegram delivery. flowchart TD
A[Shared reply content] --> B[Telegram presentation adapter]
B --> C{Control can render natively?}
C -->|Yes| D[Label-limited inline buttons]
C -->|No| E[Complete fallback text]
B --> E
D --> F[Telegram message delivery]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +132. Total +138 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep native-choice deduplication in Telegram’s shared presentation owner, with complete textual degradation for unavailable controls. Do we have a high-confidence way to reproduce the issue? Yes, from source: a plain-account reply containing native controls and marked authored fallback retains the choice list on current main. The added cases exercise that exact input, but this review did not execute them. Is this the best way to solve the issue? Yes. The patch reuses the existing partitioning and limit adapter at the common Telegram rendering boundary without adding another rendering path or changing action targets. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 427abe8b786d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged as b4c9407. Proof: 171 focused tests pass. The exact-head required CI gate is green, and the final independent review is clean at platinum. All seven observable acceptance clauses pass through the approved isolated, built Gateway with a mock Telegram API and provider.
Live Telegram client behavior was not observed: the leased Test Server setup failed group membership. The explicitly approved mock-Gateway route supplies boundary proof, not a live Telegram send claim. |
…aw#140108) Use the remaining presentation text when Telegram renders native controls, and apply existing label limits only to native labels so unavailable choices retain their full text. Preserve independent prose, plain fallback, table content and typed command/link targets. Verified with focused regressions and isolated Gateway delivery proof. Co-authored-by: Ayaan Zaidi <[email protected]>
…44653) Related: #136257. Follows the shared presentation contract in #144329 and the Telegram behavior in #140108. ## What Problem This Solves Fixes an issue where Slack replies repeat authored choice text beside native controls, or lose the authored continuation when a presentation needs a text fallback. Large select menus can also make delivery fail when their expanded accessibility summary exceeds the message limit. ## Why This Change Was Made Slack now uses the presentation marker to choose native content or the complete literal fallback. Independent companions survive that choice. The registered channel and outbound adapter share normalization, including removal of saved fallback text after a policy rewrite clears the presentation. Derived accessibility text is bounded while native controls remain intact. Authored text still uses the existing message splitting path. Literal fallbacks bypass incompatible preview and native streaming paths. ## User Impact Supported controls appear once. Unsupported commands remain copyable, with their full authored continuation. Rich-text companions survive long replies, and policy changes cannot revive retired fallback text. ## Evidence - Baseline `7f8a694ee1c862db91b056f0c950ca03b20effb1`: 13 focused regression failures, plus captured duplication and lost continuation through an isolated Gateway. - 444 focused tests pass across nine Slack owner and sibling files, including the registered channel, outbound adapter, reply compiler, native-data fallback, sends, slash replies, preview dispatch, and preview finalization. - Isolated mock-Gateway proof covers 27 cases: one actions block with six selects of 100 options each, rich-text companions, a continuation above 40,000 characters, policy clear/rewrite, and native-data rejection. - Additional baseline/candidate proof drives five scenarios through the shipped Slack Socket Mode receiver, durable ingress, session admission, and real dispatch. Short and long companion replies follow an acknowledged active preview; API captures include deletion of that preview and complete final delivery. - Formatting, focused lint, line-count and assertion-safety checks pass. Type checks and full CI are left to GitHub. - The approved validation scope for this extraction is isolated mock-Gateway proof; a live Slack round-trip is not required and was not run. Socket Mode proof uses a local Slack service and the real Slack SDK; supplemental outbound proof drives the registered adapter and real sender through a fake client. No live Slack UI or Telegram result is claimed. No config keys, schema, or persistence changes. Co-authored-by: Ayaan Zaidi <[email protected]>
…enclaw#144653) Related: openclaw#136257. Follows the shared presentation contract in openclaw#144329 and the Telegram behavior in openclaw#140108. ## What Problem This Solves Fixes an issue where Slack replies repeat authored choice text beside native controls, or lose the authored continuation when a presentation needs a text fallback. Large select menus can also make delivery fail when their expanded accessibility summary exceeds the message limit. ## Why This Change Was Made Slack now uses the presentation marker to choose native content or the complete literal fallback. Independent companions survive that choice. The registered channel and outbound adapter share normalization, including removal of saved fallback text after a policy rewrite clears the presentation. Derived accessibility text is bounded while native controls remain intact. Authored text still uses the existing message splitting path. Literal fallbacks bypass incompatible preview and native streaming paths. ## User Impact Supported controls appear once. Unsupported commands remain copyable, with their full authored continuation. Rich-text companions survive long replies, and policy changes cannot revive retired fallback text. ## Evidence - Baseline `c0b5fcea59ff5d2fd609802aca3b9e8a5e34021c`: 13 focused regression failures, plus captured duplication and lost continuation through an isolated Gateway. - 444 focused tests pass across nine Slack owner and sibling files, including the registered channel, outbound adapter, reply compiler, native-data fallback, sends, slash replies, preview dispatch, and preview finalization. - Isolated mock-Gateway proof covers 27 cases: one actions block with six selects of 100 options each, rich-text companions, a continuation above 40,000 characters, policy clear/rewrite, and native-data rejection. - Additional baseline/candidate proof drives five scenarios through the shipped Slack Socket Mode receiver, durable ingress, session admission, and real dispatch. Short and long companion replies follow an acknowledged active preview; API captures include deletion of that preview and complete final delivery. - Formatting, focused lint, line-count and assertion-safety checks pass. Type checks and full CI are left to GitHub. - The approved validation scope for this extraction is isolated mock-Gateway proof; a live Slack round-trip is not required and was not run. Socket Mode proof uses a local Slack service and the real Slack SDK; supplemental outbound proof drives the registered adapter and real sender through a fake client. No live Slack UI or Telegram result is claimed. No config keys, schema, or persistence changes. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Telegram could show the same choices in both message text and native controls. Control-only replies also repeated the choice list.
Why This Change Was Made
The presentation owner uses the text remaining after native controls are selected. Plain delivery keeps the authored fallback, and native label limits no longer shorten unavailable text-only choices.
User Impact
Choices appear once while independent prose, tables, prompts, unavailable choices, and command targets remain intact.
Evidence
A real Gateway with controlled channel responses reproduced duplication before the fix and showed one prompt with controls afterward. Native command callbacks cleared the keyboard and produced one result. All 171 focused presentation and delivery tests passed. Live Telegram proof was blocked by the required group-membership check.
Consumers: Telegram native presentation uses the remaining text; plain delivery preserves the authored fallback.