fix(qqbot): authorize approval buttons for dm chat type - #43957
Open
LeDaVinci wants to merge 2 commits into
Open
fix(qqbot): authorize approval buttons for dm chat type#43957LeDaVinci wants to merge 2 commits into
LeDaVinci wants to merge 2 commits into
Conversation
…#43926) The QQBot adapter uses "dm" as the chat_type for direct messages (guild-based DMs and direct chats), but _is_authorized_interaction_for_session only checked for "c2c", causing all approval button clicks in DM contexts to be rejected as unauthorized even when the operator matched the session owner. Add "dm" to the same authorization branch as "c2c" since both are 1-on-1 contexts where operator == chat_id is the correct check.
Collaborator
Author
|
Added a follow-up commit for QQBot transport recovery: transient DNS / websocket / token failures now leave QQBot in retrying state and keep the reconnect loop alive instead of hard-stopping at the reconnect limit. Also added a regression test in tests/gateway/test_qqbot.py. |
Contributor
|
Thanks for identifying the direct-C2C session-key mismatch: it remains present on current main. Problems
Suggested changes
Automated hermes-sweeper review. |
Collaborator
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.
Problem
Approval button clicks in QQ DM channels are always rejected with:
even when the operator and session owner are the same person.
Root Cause
The QQBot adapter uses
dmas the chat_type for direct messages (both guild-based DMs and direct chats — see lines 1288 and 1498 inadapter.py). However,_is_authorized_interaction_for_sessiononly checks forc2c:Since
dmdoesn't matchc2corgroup/guild, it falls through toreturn False, blocking all approval interactions.Fix
Add
dmto the same authorization branch asc2c— both are 1-on-1 contexts whereoperator == chat_idis the correct check:Testing
Verified locally: approval buttons in QQ DM now correctly authorize and unblock the agent's pending command.