mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
fix(telegram): set REQUIRES_EDIT_FINALIZE so final MarkdownV2 edit is not skipped
When the final streamed text is identical to the last plain-text edit, stream_consumer._send_or_edit short-circuits and never calls adapter.edit_message(finalize=True). For Telegram, this skips the plain-text → MarkdownV2 conversion, leaving raw Markdown syntax visible to the user. Set REQUIRES_EDIT_FINALIZE = True on TelegramAdapter so the finalize edit is always delivered, matching the existing DingTalk pattern. Fixes #25710
This commit is contained in:
parent
cd64bed55e
commit
d44dafdb4e
1 changed files with 7 additions and 0 deletions
|
|
@ -332,6 +332,13 @@ class TelegramAdapter(BasePlatformAdapter):
|
|||
MEDIA_GROUP_WAIT_SECONDS = 0.8
|
||||
_GENERAL_TOPIC_THREAD_ID = "1"
|
||||
|
||||
# Telegram's edit_message applies MarkdownV2 formatting only on the
|
||||
# finalize=True path. Without this flag, stream_consumer._send_or_edit
|
||||
# short-circuits when the raw text is unchanged between the last streamed
|
||||
# edit and the final edit, skipping the plain-text → MarkdownV2 conversion.
|
||||
# Fixes #25710.
|
||||
REQUIRES_EDIT_FINALIZE: bool = True
|
||||
|
||||
# Adaptive text-batch ingress: short messages need a tighter delay so the
|
||||
# first token reaches the agent fast. Numbers tuned for "feels instant":
|
||||
# ≤320 codepoints (one short paragraph) settles in ~180ms; ≤1024
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue