fix(telegram): avoid rich final duplicate previews (#46206)

This commit is contained in:
Teknium
2026-06-14 11:13:38 -07:00
committed by GitHub
parent 6c34088a17
commit a1f51feb72
13 changed files with 83 additions and 69 deletions
+9
View File
@@ -635,6 +635,15 @@ class GatewayStreamConsumer:
)
if self._final_response_sent:
self._final_content_delivered = True
elif self._fallback_final_send:
# The final edit attempt itself may be the one
# that exhausts flood-control strikes and
# promotes the consumer into fallback mode. Do
# not return to the gateway with a full-response
# fallback still pending; send only the unsent
# tail here so the normal gateway send path does
# not duplicate the visible prefix.
await self._send_fallback_final(self._accumulated)
elif not self._already_sent:
self._final_response_sent = await self._send_or_edit(self._accumulated)
if self._final_response_sent: