Skip to content

feat(telegram): support copy text buttons - #69153

Open
kilhyeonjun wants to merge 1 commit into
NousResearch:mainfrom
kilhyeonjun:feat/telegram-copy-text-buttons-v2
Open

feat(telegram): support copy text buttons#69153
kilhyeonjun wants to merge 1 commit into
NousResearch:mainfrom
kilhyeonjun:feat/telegram-copy-text-buttons-v2

Conversation

@kilhyeonjun

Copy link
Copy Markdown

Summary

  • add Telegram COPY_BUTTON: label | text markers that render as Bot API CopyTextButton inline keyboard buttons
  • keep malformed markers visible and preserve compatibility when CopyTextButton is unavailable
  • support normal sends, short streaming-final edits, and final responses split over Telegram's 4,096 UTF-16-unit limit
  • attach overflow keyboards only to the final visible continuation and preserve them through plain/reply fallback paths
  • document syntax, limits, and delivery behavior

Replaces #59445 with a clean Telegram-only branch from current main. The unrelated Codex usage, credential telemetry, and network circuit-breaker commits are intentionally excluded.

Test Plan

  • RED: overflow final test failed because the last continuation had no reply_markup
  • uv run --with pytest --with pytest-asyncio --extra messaging python -m pytest tests/gateway/test_telegram_copy_buttons.py tests/gateway/test_telegram_clarify_buttons.py tests/gateway/test_telegram_rich_messages.py tests/gateway/test_telegram_thread_fallback.py tests/gateway/test_telegram_overflow_partial.py -q -o 'addopts=' — 148 passed
  • uv run --extra dev ruff check plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_copy_buttons.py
  • uv run --extra messaging python -m py_compile plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_copy_buttons.py
  • git diff --check
  • changed-line security scan — 0 findings

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/telegram Telegram bot adapter duplicate This issue or pull request already exists labels Jul 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate/superseding iteration of still-open #59445: it keeps the same Telegram CopyTextButton marker feature on a clean branch. Maintainers can retain the preferred branch and close the other.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Telegram implementation and overflow/fallback coverage.

Problems

  • The feature is not applied to standalone Telegram delivery. plugins/platforms/telegram/adapter.py:9831-9859 delegates cron standalone sends to tools/send_message_tool.py:_send_telegram; that sender formats and sends the original text at tools/send_message_tool.py:1178-1206 and 1302-1342 without marker extraction or reply_markup. Thus a valid marker sent through cron or send_message remains visible text rather than becoming a copy button.

Suggested changes

  • Reuse the marker parser/markup construction for _send_telegram, and add standalone-path tests for normal, chunked, and fallback sends. Attach the markup only to the final visible text chunk.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Three PRs address Telegram copy-text buttons: #59443 introduced the marker-based implementation but mixed in Codex telemetry, #59445 repeated it with additional unrelated network work and incomplete overflow handling, and #69153 isolates the Telegram change and fixes overflow/fallback delivery within the adapter. The current #69153 diff still does not apply marker extraction or reply markup to standalone Telegram sends through tools/send_message_tool.py.

Related pull requests

Duplicates

#59443, #59445, and #69153 implement substantially the same COPY_BUTTON feature; #59443 is the closed original, #59445 is its mixed-scope successor, and #69153 is the focused superseding iteration.

Suggested consolidation

Keep #69153 open with a salvage path: reuse its marker parser and markup construction in tools/send_message_tool.py:_send_telegram, attach markup only to the final visible chunk, and add standalone normal, chunked, and fallback tests, as identified by the keep_open maintainer-bot verdict. Close #59445 as a duplicate superseded by #69153 despite its earlier keep_open review, because #69153 already provides the requested focused split and overflow fix; #59443 is already closed and remains in the same supersession chain.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    subgraph Dup59443 ["PRs duplicating each other"]
        P59443["PR #59443 (closed)"]
        P59445["PR #59445 (open)"]
        P69153["PR #69153 (open)"]
    end
    class P59443 closed
    class P59445 open
    class P69153 open
    class P69153 target
    click P59443 "https://github.com/NousResearch/hermes-agent/pull/59443"
    click P59445 "https://github.com/NousResearch/hermes-agent/pull/59445"
    click P69153 "https://github.com/NousResearch/hermes-agent/pull/69153"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 3 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 198 kB of PR diffs, 3 kB of issue/PR text, 3 kB of discussion (4 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants