← Back to PRs

#5764: fix(telegram): enable streaming in private chats without topics

by garnetlyx open 2026-01-31 23:20 View on GitHub →
channel: telegram agents
## Summary Fixes Telegram draft streaming not working in private chats. ## Problem Private chats don't have `message_thread_id`, so the condition `typeof draftThreadId === number` was false, disabling streaming entirely. ## Changes - Changed the streaming condition from: ```typescript canStreamDraft = streamMode !== off && isPrivateChat && typeof draftThreadId === number && ... ``` - To: \\\ ## Test Plan - Private chats: streaming should work (no thread ID needed) - Group chats: streaming still requires thread ID and topics enabled Closes: (researched issue in repo) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR primarily fixes Telegram draft streaming by allowing streaming in private chats that don’t have a `message_thread_id`. While doing that, it also introduces a structured `AllModelsFailedError` and updates the unhandled rejection handler to treat “all models in cooldown” as non-fatal (logging retry hints instead of exiting). Dependency overrides were also adjusted (notably pinning `esbuild` and `hono`, and updating the lockfile accordingly). <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge; changes are localized and mostly additive, with minor clarity/robustness concerns. - Telegram logic change is straightforward, and the new error class + unhandled rejection handling is additive. The main concerns are around correct classification of cooldown reasons and log usefulness, but I didn’t see a clear runtime-breaking issue introduced. - src/agents/model-fallback.ts and src/infra/unhandled-rejections.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs