You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add bot run cancellation and timeout support (#1919)
* fix: add bot run cancellation and timeout support (fixes#1917)
- Add MESSAGE_ABORT event type to gateway protocols
- Enhance BotSessionManager with InterruptController integration
- Add configurable run_timeout parameter (default 300s)
- Implement cancel_run() method for user-initiated cancellation
- Add /stop command for cancelling active runs
- Add BotRunTimeout exception for timeout handling
- Maintain backward compatibility
- Follow protocol-driven architecture from AGENTS.md
Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
* fix: resolve critical bugs in bot run cancellation and timeout support
Fixes three critical issues identified by code review:
1. Fix parameter name mismatch: Agent.chat() expects 'cancel_token', not 'interrupt_controller'
- Cooperative cancellation is now functional
2. Wire /stop command to all bot adapters (telegram, discord, slack, whatsapp)
- Users can now actually cancel runs via /stop command
3. Prevent BotRunTimeout from being queued in DLQ to avoid infinite retry loops
- Timeout exceptions are excluded from replay to prevent loops
Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
---------
Co-authored-by: praisonai-triage-agent[bot] <272766704+praisonai-triage-agent[bot]@users.noreply.github.com>
Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments