Telegram Bot Not Receiving Messages When Session Closed
Environment:
• OS: Linux (VPS)
• Channel: Telegram
• Setup: Multiple agents with Telegram bot bindings
Problem:
Telegram bots stop polling for new messages when their session ends (status: "done"). This breaks agent-to-agent communication via sessions_send and makes bots unresponsive to user messages until the next heartbeat.
Steps to Reproduce:
- Create agent with Telegram bot binding
- Send message to bot → bot responds → session ends (status: "done")
- Send another message to bot
- Expected: Bot receives message immediately
- Actual: Bot doesn't receive message until next heartbeat (5+ minutes later)
Current Behavior:
• ✅ Bot polls when session is active
• ❌ Bot stops polling when session closes
• ❌ New messages not received until heartbeat wakes session
• ❌ sessions_send to closed session fails silently
Expected Behavior:
• ✅ Bot continuously polls Telegram API regardless of session state
• ✅ New messages trigger new session immediately
• ✅ sessions_send wakes target session if closed
Workarounds Tried:
- ✅ Heartbeat every 5 min → too slow for real-time
- ✅ Manual /start before each message → annoying
- ❌ sessions_send to wake session → doesn't work
Use Case:
Multi-agent workflow where CMO coordinates with Copywriter, Content Strategist, and CRO Specialist via sessions_send. CMO sends task → agent responds → CMO session closed → agent's response lost.
Proposed Solution:
Enable continuous Telegram polling for agent bots independent of session state, similar to how traditional Telegram bots work (long polling or webhooks).
Is there a config option to enable continuous Telegram polling? Or is this a feature request for the roadmap?