fix(qqbot): treat DM chat_type same as C2C for approval buttons and message delivery - #41801
fix(qqbot): treat DM chat_type same as C2C for approval buttons and message delivery#41801HongChenGG wants to merge 2 commits into
Conversation
…essage delivery QQ private-message session keys may be recorded as 'dm' while C2C button events authorize against the same user_openid. Treat both spellings as the same private chat in: - _is_authorized_interaction_for_session: approval clicks from QQ DMs were incorrectly rejected as unauthorized - _send_chunk: text/keyboard delivery to DM recipients - _send_media: media delivery path selection Without this fix, users in QQ DMs see 'Rejected unauthorized approval click' when trying to approve agent actions, and bot replies to DMs may fail with 'Unknown chat type'.
|
The
Both should use |
- send_typing(): chat_type != 'c2c' → not in {'c2c', 'dm'}
- _upload_media(): target_type == 'c2c' → in {'c2c', 'dm'}
Addresses review feedback on NousResearch#41801.
|
Thanks for catching these! Fixed both:
Also updated the docstring for send_typing to reflect DM support. |
Problem
QQ Bot adapter's only checks for , but QQ DM session keys are recorded as . This causes:
Fix
Treat the same as in 4 locations:
== "c2c"→in {"c2c", "dm"}_send_chunk(text)_send_chunk(keyboard)_send_mediaContext
chat_type="c2c"in_chat_type_map_handle_dm_messagewhich storeschat_type="dm"chat_type="dm"for both paths