fix(telegram): respect plugin requireAuth:false for callback_query in DMs#28663
fix(telegram): respect plugin requireAuth:false for callback_query in DMs#28663kilhyeonjun wants to merge 2 commits into
Conversation
… DMs When inlineButtonsScope is 'allowlist' (default), callback_query handler enforces DM authorization regardless of the target plugin command's requireAuth setting. This causes inline buttons to silently fail in DMs for plugins that set requireAuth: false, even though the same command works when typed manually. Check if callback data matches a plugin command with requireAuth: false and relax to callback-scope mode, matching typed-command auth behavior. Fixes openclaw#28659
Greptile SummaryFixes inline buttons failing in DMs for plugins with Key Changes:
Scope:
Confidence Score: 5/5
Last reviewed commit: 65f864e |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
Fixes #28659
When
inlineButtonsScopeis"allowlist"(default), thecallback_queryhandler enforces DM authorization regardless of the target plugin command'srequireAuthsetting. This causes inline buttons to silently fail in DMs for plugins that setrequireAuth: false, even though the same command works when typed manually.Root Cause
In
bot-handlers.ts, the callback_query handler resolvesauthorizationModebased solely oninlineButtonsScope:For
callback-allowlistmode,enforceDirectAuthorization: truerequires DM senders to pass the pairing/allowlist check. But plugin commands registered withrequireAuth: falseintentionally opt out of auth — typed/commandin DM works becauseresolveTelegramCommandAuthskips the check whenrequireAuth: false.The disconnect: callback_query ignores the plugin's auth setting, blocking inline buttons that the plugin explicitly made public.
Fix
Before the auth check, look up whether the callback data matches a plugin command with
requireAuth: false. If so, relax fromcallback-allowlisttocallback-scopemode (which skips DM authorization but still enforces group policy viashouldSkipGroupMessage).Scope
requireAuth: falsecallback-allowlist→callback-scope(group policy still enforced)requireAuth: true(default) plugin commands