fix: treat [object Object] sentinel as absent in Telegram reply_to_text - #68428
fix: treat [object Object] sentinel as absent in Telegram reply_to_text#68428Jake-P-Shalmi wants to merge 1 commit into
Conversation
When a user replies to a rich message (sendRichMessage, Bot API 10.1), Telegram echoes the literal string '[object Object]' as reply_to_message.text instead of returning empty/None. The adapter accepted this as valid reply text (it's a truthy string), skipping the rich-reply and sent-store fallbacks that would have recovered the real content. This caused the agent to see '[object Object]' as the reply-to context instead of the actual message body. Add a guard that detects the sentinel and sets reply_to_text to None, so the existing fallback chain (_extract_rich_reply_text → rich_sent_store.lookup) fires as intended.
|
Thanks for the focused Telegram fallback fix. Current No blocking issues identified. This is an automated hermes-sweeper review. |
SummaryFourteen PRs address or reference the Telegram reply-context complex: #1596/#1662 establish out-of-session reply context, while #2694/#22632/#22633/#22676/#22709/#23091/#70631 handle native partial quotes and agent-visible injection. The remaining PRs cover adjacent reply-context gaps: observed audio (#43200), topic quote metadata (#47487), forwarded and long reply context (#54262), reply authorship (#56203), and rich-message sentinel recovery (#68428). Related pull requests
Duplicates#1596 and #1662 share the #1594 reply-context core, with #1662 the focused merged extraction; #22632, #22633, #22676, #22709, and #23091 implement substantially the same #22619 partial-quote fix, with #22676 the merged salvage, while #2694 overlaps that core and additionally removes injection suppression; #70631 duplicates the already agent-visible partial-quote path on main. Suggested consolidationKeep #68428 open with its focused salvage path: normalize Cross-PR triage: Reviewed 14 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 160 kB of PR diffs, 31 kB of issue/PR text, 17 kB of discussion (16 comments), 14 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
When a user replies to a rich message (
sendRichMessage, Bot API 10.1), Telegram echoes the literal string[object Object]asreply_to_message.textinstead of returning empty/None. The adapter accepted this as valid reply text (it's a truthy string), skipping the_extract_rich_reply_textandrich_sent_store.lookupfallbacks that would have recovered the real content.This caused the agent to see
[object Object]as the reply-to context instead of the actual message body — e.g. replying to a cron-delivered morning briefing produced:Fix
Add a guard after the
.text/.captionextraction that detects the[object Object]sentinel and setsreply_to_text = None. This lets the existing fallback chain fire as intended:_extract_rich_reply_text()— parses Telegram's native rich-message echorich_sent_store.lookup()— recovers from the local send-time indexTest Plan
test_object_object_sentinel_treated_as_absentverifies the sentinel is not passed through