fix(telegram): preserve link preview disable on edits - #61022
Open
samrusani wants to merge 1 commit into
Open
Conversation
samrusani
marked this pull request as ready for review
July 11, 2026 15:36
1 task
samrusani
force-pushed
the
fix/61018-telegram-edit-link-previews
branch
from
August 3, 2026 07:15
c881918 to
ce02187
Compare
Contributor
Author
|
Rebased onto current The only conflict was the reorganized Validation on the rebased head:
GitHub now reports the PR mergeable; CI is running. |
This was referenced Aug 4, 2026
Open
Open
1 task
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 does this PR do?
Fixes the Telegram legacy edit path so
platforms.telegram.extra.disable_link_previews: trueis honored when assistant output is updated viaedit_message_text.The initial send path already passed
link_preview_options, but streaming edits, final MarkdownV2 edits, plain-text fallback edits, retry edits, and overflow first-chunk edits did not. That let Telegram create URL preview cards during response edits even though the user had disabled link previews.Related Issue
Fixes #61018
Type of Change
Changes Made
plugins/platforms/telegram/adapter.py: passself._link_preview_kwargs()through all legacy Telegramedit_message_textcalls used by streaming edits, final MarkdownV2 edits, fallback edits, retry edits, and overflow first-chunk edits.tests/gateway/test_telegram_format.py: add regressions provingdisable_link_previewsis preserved for non-final edits, final Markdown/fallback edits, and overflow first-chunk edits.How to Test
./.venv/bin/pytest tests/gateway/test_telegram_format.py::TestEditMessageStreamingSafety -q./.venv/bin/pytest tests/gateway/test_telegram_format.py -q./.venv/bin/python -m py_compile plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_format.pygit diff --checkChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass.venv/ Python 3.11-compatible test environmentDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Focused validation passed locally:
./.venv/bin/pytest tests/gateway/test_telegram_format.py::TestEditMessageStreamingSafety -q— 12 passed./.venv/bin/pytest tests/gateway/test_telegram_format.py -q— 112 passed./.venv/bin/python -m py_compile plugins/platforms/telegram/adapter.py tests/gateway/test_telegram_format.pygit diff --check