Skip to content

fix(telegram): recover final delivery after stream flood - #62476

Merged
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/62253-telegram-final-delivery
Jul 11, 2026
Merged

kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/62253-telegram-final-delivery

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Contributor

Summary

Telegram final delivery now recovers after a flooded streaming edit without deleting earlier finalized stream segments or waiting through a second long flood cooldown.

Changes

  • Preserve @helix4u's final-edit flood fallback and empty-tail final commit.
  • Scope empty-tail cleanup to the active stream segment, preserving pre-tool preambles/commentary.
  • Keep Telegram's structured long-flood delay, but leave delivery to the normal gateway path instead of sleeping through a long retry in the stream task.
  • Add regression coverage for the real Telegram flood result, long-delay behavior, and tool-boundary cleanup.

Validation

Check Result
scripts/run_tests.sh targeted streaming suite 164 passed
Real adapter long-flood contract + segment cleanup smoke passed
Ruff / py_compile / git diff --check passed
Codex final review clean

Attribution

  • fe7522fbb@helix4u's original final-delivery recovery implementation, preserved by cherry-pick.
  • 286040d63 — follow-up hardening for reviewer-found cleanup and flood-retry defects.

Closes #62253
Related: #55869, #59864, #54331

helix4u and others added 2 commits July 11, 2026 10:53
Keep empty-tail recovery scoped to the current stream segment and bound fallback flood retries. Preserve Telegram's server retry hint without blocking final delivery through a long cooldown.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages P2 Medium — degraded but workaround exists labels Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Salvage / superseding of #62253 (@helix4u): this PR preserves #62253's original final-delivery recovery commit (fe7522fbb) via cherry-pick and adds follow-up hardening (286040d63) for reviewer-found cleanup/flood-retry defects. Same files and mechanism as #62253 (gateway/stream_consumer.py + Telegram adapter + final-delivery regression test), so this is related_to #62253, not a duplicate. Both are open; a maintainer should pick which to merge (this one is the superset with the extra hardening + segment-scoped cleanup). Same Telegram flood-control final-delivery family as #55869 / #59864 / #54331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants