feat: telegram interface, chat/task modes for interfaces#521
feat: telegram interface, chat/task modes for interfaces#521onuratakan merged 4 commits intomasterfrom
Conversation
DoganK01
commented
Feb 5, 2026
- Telegram tool and interface
- Fixed gmail encoding issue for letters non-ASCII
- Chat and Task modes for Interfaces. Chat mode creates a Chat instance, Task mode creates Agent instance
PR Review: Telegram Interface + Chat/Task ModesThanks for this substantial addition. The Telegram integration is well-structured and the Chat/Task mode abstraction across all interfaces is a solid design. Here is the detailed feedback, organized by category. Bugs / Correctness Issues1. hmac.new(...) # This is wrong — the correct call is hmac.new() in Python 2 only.In Python 3, hmac.new(key, msg, digestmod) # actually this IS valid in Python 3 as wellCorrection: 2. 3. 4. Chat session keyed on Security Concerns5. 6. Bot token is included in health check response (telegram.py:190) 7. Webhook secret comparison timing (telegram.py:249) if secret != self.webhook_secret:This is a plain string comparison, which is vulnerable to timing attacks. Use Code Quality / Design8. Massive code duplication across 9. 10. cmd1 = InterfaceResetCommand()
cmd1.command = "/clear"
cmd2 = InterfaceResetCommand()
print(cmd2.command) # Still "/reset" — but only because Python creates an instance attr on cmd1This works by accident. If someone does 11. Performance12. No file size limits on media downloads (telegram.py:556, tool line 842) 13. Temp files in Test Coverage14. Zero tests for any of the new code
Given that the project has a Minor / Nits
SummaryThe overall structure is good and the Chat/Task mode abstraction is a worthwhile addition. The main blockers before merge are the unauthenticated webhook management endpoints (#5), the timing-attack-vulnerable secret comparison (#7), and the missing tests (#14). The code duplication (#8) and the |
b1af06a to
855053f
Compare