fix(gateway): stop payload-less split delivery from swallowing Telegram finals - #78558
fix(gateway): stop payload-less split delivery from swallowing Telegram finals#78558HexLab98 wants to merge 2 commits into
Conversation
Record an unsplit stream ledger for multi-message deliveries and refuse legacy trust when split delivery left no payload, so Telegram group sessions no longer suppress a complete reply after an early/partial finalize (NousResearch#78541).
Add unit and GatewayRunner boundary coverage for the NousResearch#78541 shape where final_content_delivered is set via split delivery with no recorded payload.
|
Merged via #79669 — your commits were cherry-picked with authorship preserved ( Your diagnosis was exactly right: the multi-message split path set I added follow-up commits before merging, because six code paths set
Row 2 would have re-opened the double-answer that #45517 fixed (#36965 / #25349). Row 4 is the one worth flagging: The follow-up fixes the producers rather than only distrusting them at the boundary: record the visible payload on the failed-final-edit branch, route the three fallback sites through Added four tests that drive the real overflow-split loop instead of hand-setting private flags, each mutation-checked so reverting any individual fix turns its own test red. Full CI green (8/8 slices). Thanks — the root-cause analysis and the ledger design were the hard part, and both shipped. |
Summary
final_content_deliveredwithout recording a payload, sodelivered_final_matches()returnedNoneand the gateway's legacy trust suppressed the normal final send._stream_ledgerfor overflow splits, record it on turn-final delivery, and treat payload-less split delivery as a mismatch (False) so the complete reply is reconciled or sent.Test plan
scripts/run_tests.sh tests/gateway/test_stale_finalize_suppression.py -qscripts/run_tests.sh tests/gateway/test_stale_finalize_suppression.py tests/gateway/test_stream_consumer_fresh_final.py tests/gateway/test_telegram_final_delivery.py -qSuppressing normal final sendghost).Fixes #78541