fix(gateway): resolve Telegram/channel message processing crash#36
Open
fix(gateway): resolve Telegram/channel message processing crash#36
Conversation
ChannelManager._handle_message() passes session_key to the agent's process() and process_with_thinking() methods for multi-user session isolation, but these methods did not accept the parameter — causing a TypeError that silently crashed every message processing attempt. This broke all channel messaging (Telegram, Discord, etc.) since the agent could never process any inbound message. Adds optional session_key parameter to both methods with automatic session switching when a different key is provided. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChannelManager._handle_message()passessession_keytoAgentLoop.process()andprocess_with_thinking()for per-user session isolation, but these methods did not accept the parameter — causing aTypeErrorthat silently crashed every message attemptsession_key: str | None = Noneparameter to bothprocess()andprocess_with_thinking()methodsImpact
All channel messaging was broken (Telegram, Discord, Feishu, etc.) since the agent could never successfully process any inbound message. Every message resulted in:
This was caught by the generic error handler in the bus, returning "Sorry, an unexpected error occurred" to all users.
Test plan
spoon-bot gatewayprocess_with_thinking()pathMade with Cursor