Commit 2ef9552
committed
fix: Disable spinner animation to stay within rate limits (v1.6.4)
CRITICAL FIX: Animated spinner was causing excessive API calls.
## Problem
Each editMessageText() counts as 1 API call toward Telegram's
20 msgs/min per-chat limit. The spinner animation updated every
1 second, which means:
- 5 tools × 10 seconds = 50 seconds execution
- Spinner updates: 50 calls
- Tool status changes: 10 calls
- Text updates: ~5 calls
- Total: ~65 calls/min → EXCEEDS 20/min limit!
Even at 3-second intervals:
- Spinner: ~16 calls
- Other: ~15 calls
- Total: ~31 calls/min → Still exceeds limit!
## Solution
**Disable spinner animation entirely.** The tool overview now only
updates when tool status actually changes (start/done), not on a
timer.
Updates per minute:
- Tool status changes: ~10 calls
- Text updates: ~5 calls
- Done message: 1 call
- Total: ~16 calls/min ✅ Within 18/min limit
## Impact
**Before (with spinner):**
- Tool overview updates ~50 times/min
- Risk of hitting rate limit
- Could cause 429 errors
**After (no spinner):**
- Tool overview updates only on status change (~10 times)
- Well within rate limits
- No 429 risk
## User Experience
Still responsive because:
- Tool status changes update IMMEDIATELY
- Counter updates in real-time (0/4 → 1/4 → 2/4)
- No perceived delay since updates happen on meaningful events
- Users see progress, just not cosmetic spinner animation
## Key Insight
Telegram counts EVERY API call:
- sendMessage = 1 call
- editMessageText = 1 call ⭐️
- deleteMessage = 1 call
There's no "free" edit operation. Even simple cosmetic updates
consume the rate limit budget.
## Files Changed
- src/telegram-message-queue.ts: Disable spinner, update only on status change
- doc/rate-limiting.md: Document why spinner is disabled
Prevents rate limit exhaustion from cosmetic updates.1 parent cac8f09 commit 2ef9552
3 files changed
Lines changed: 16 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
297 | 303 | | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
301 | 307 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
325 | 311 | | |
326 | 312 | | |
327 | 313 | | |
| |||
0 commit comments