fix(qqbot): approval button auth rejects DM sessions - #33962
Conversation
Added 20 new file extensions to the media_pattern regex in BasePlatformAdapter.extract_media(): Code: py, js, ts, sh, rb, go, rs, java, c, cpp, h Config/Data: yaml, yml, toml, json, xml, sql Markup: md, html, htm, css Previously only media/document formats were supported (png, jpg, pdf, zip, docx, etc.). Users can now send code and config files via MEDIA: tag across all messaging platforms.
…_type The gateway generates session keys with 'dm' for QQ direct messages (e.g. agent:main:qqbot:dm:OPENID), but _is_authorized_interaction_for_session only checked for 'c2c'. This caused all QQ c2c approval button clicks to be rejected as unauthorized. Fix: accept both 'c2c' and 'dm' as valid chat_type values for direct message authorization.
|
I found one issue worth addressing before merge. Bundled unrelated change: MEDIA regex extension in This PR modifies The qqbot DM authorization fix ( Suggested fix: Remove the |
Bug
QQ bot approval buttons (inline keyboard) are rejected as unauthorized in c2c (direct message) sessions.
Root Cause
The gateway generates session keys with
dmas the chat_type for QQ direct messages:But
_is_authorized_interaction_for_session()only checks forc2c:Fix
Accept both
c2canddmas valid chat_type values for direct message authorization:Impact
Without this fix, all QQ DM approval button clicks are silently rejected, causing approval timeouts. Users have to fall back to text-based
/approvecommands.Testing
Verified on QQ bot (c2c session) — approval buttons now work correctly after the fix.