feat(plugins): support actionable Telegram callback events - #85565
Open
RSapeliuk wants to merge 2 commits into
Open
feat(plugins): support actionable Telegram callback events#85565RSapeliuk wants to merge 2 commits into
RSapeliuk wants to merge 2 commits into
Conversation
Collaborator
Related competing callback-extension work: #71630 provides the earlier registered-prefix API and #21471 a pre-dispatch hook. This PR instead adds a constrained post-authorization action envelope; maintainer selection on the callback contract and precedence is needed. |
Contributor
feat(plugins): support actionable Telegram callback events
|
Author
|
Thanks for the review — addressed all four points in follow-up commit
Verification: |
14 tasks
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.
What does this PR do?
Adds a generic, authorized Telegram
callback_queryevent to the existinggateway_platform_eventplugin hook. Plugins receive a normalized plain-dict payload and may return a constrained action envelope to answer the callback and edit the message/inline keyboard. This lets user plugins implement Telegram inline-button workflows without monkey-patching the Telegram adapter or embedding feature-specific code in Hermes.Related Issue
N/A — this is a reusable plugin extensibility feature motivated by Telegram inline-button plugins.
Type of Change
Changes Made
gateway_platform_eventdispatch path.callback_querynormalization with stable string/dict fields only.answer/editaction envelope in the Telegram adapter, including inline keyboard reconstruction.How to Test
python -m pytest tests/gateway/test_gateway_platform_event_hook.py -q -o addopts=''python -m compileall -q gateway/run.py plugins/platforms/telegram/adapter.py tests/gateway/test_gateway_platform_event_hook.pyChecklist
Code
feat(plugins): ...)36 passed)Documentation & Housekeeping
website/docs/user-guide/features/hooks.md)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture/workflow — N/AFor New Skills
Screenshots / Logs
Targeted test output: