fix(telegram): keep quoted context + avoid QUOTE_TEXT_INVALID#12156
fix(telegram): keep quoted context + avoid QUOTE_TEXT_INVALID#12156obviyus merged 5 commits intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a1e0d10e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed review note about nested quote reuse. Change in latest commit (8d9f46e):
This avoids misclassifying ordinary replies as quoted when the replied-to message itself contained an older quote. |
|
Addressed review note about nested quote reuse in latest commit 8d9f46e. Removed fallback to replied-message quote text; quote extraction now uses only current message quote and external_reply quote. |
…ntext-and-safe-reply
|
All checks are now green and I resolved the outstanding discussion thread.\n\nGiven this is a Telegram-related fix, a maintainer review from @joshp123 would be great if available. |
Summary
external_replyin addition toreply_to_messagemessage.quote,reply_to_message.quote, andexternal_reply.quotereply_to_message_idthreading for outbound Telegram sends and stop emittingreply_parameters.quoteto avoid Bot APIQUOTE_TEXT_INVALIDWhy
Telegram partial-quote replies can come through
external_reply, which previously dropped quoted text from model context. Also, sending quoted replies viareply_parameters.quoteis fragile and can fail whole deliveries with400 QUOTE_TEXT_INVALID.Tests
reply_to_message_ideven when quote text existsexternal_replyNotes
I could not finish full test suite on this host in-session (dependency install was long), so this is smoke-validated in a live Telegram channel and covered by targeted test updates.
Greptile Overview
Greptile Summary
This PR improves Telegram quote/reply handling in two ways:
describeReplyTargetnow derives quoted context not only frommessage.quote, but also fromreply_to_message.quoteandexternal_reply.quote, and falls back to text/caption/media placeholders from the reply-like object (reply_to_messageorexternal_reply).reply_parameters.quote(which can triggerQUOTE_TEXT_INVALID), and always threads replies viareply_to_message_idwhen a reply target exists.Test updates cover partial quotes delivered via
external_replyand assert that outbound threading sticks toreply_to_message_ideven when quote text is present.Confidence Score: 5/5
external_replypath and the outbound behavior change (droppingreply_parameters). No runtime errors or broken call sites were found in the modified files.(2/5) Greptile learns from your feedback when you react with thumbs up/down!