#5764: fix(telegram): enable streaming in private chats without topics
channel: telegram
agents
Cluster:
Telegram Streaming Enhancements
## 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
#19673: fix(telegram): avoid starting streaming replies with only 1-2 words
by emanuelst · 2026-02-18
83.8%
#12936: fix(telegram): omit message_thread_id for private DM chats
by omair445 · 2026-02-09
81.1%
#19479: fix(telegram): skip redundant final edit in partial streaming mode
by v8hid · 2026-02-17
80.5%
#17953: fix(telegram): prevent silent message loss and duplicate messages i...
by zuyan9 · 2026-02-16
79.0%
#14977: fix(telegram): remove ack reaction after block-streamed replies
by Diaspar4u · 2026-02-12
78.7%
#18678: fix(telegram): preserve draft message when all final payloads are e...
by julianubico · 2026-02-16
78.3%
#14443: fix(telegram): skip General topic thread ID for all chat types (#14...
by lailoo · 2026-02-12
78.3%
#19050: fix(telegram): skip message_thread_id for private chats to prevent ...
by Limitless2023 · 2026-02-17
78.2%
#7261: fix(telegram): preserve DM topic thread id for outbound media
by ViffyGwaanl · 2026-02-02
77.7%
#20623: fix(slack): duplicate replies and missing streaming recipient params
by rahulsub-be · 2026-02-19
77.0%