feat(feishu): implement Feishu typing indicator via reactions - #7235
Closed
simiwe wants to merge 4 commits into
Closed
feat(feishu): implement Feishu typing indicator via reactions#7235simiwe wants to merge 4 commits into
simiwe wants to merge 4 commits into
Conversation
simiwe
force-pushed
the
feat/feishu-typing-indicator-slim
branch
from
April 10, 2026 17:14
fad57db to
d8f1e2a
Compare
Resolve conflicts: - __init__: keep both _typing_state and _pending_processing_reactions - _handle_message_with_guards: keep typing state tracking, remove obsolete _add_ack_reaction call (replaced by on_processing_start hook) Adapt to upstream's new processing-reaction hooks: - Refactor send_typing/stop_typing to reuse upstream _add_reaction/_remove_reaction - Override on_processing_start as no-op (typing handled by send_typing via _keep_typing loop, preventing duplicate Typing reactions) - Override on_processing_complete to only add CrossMark on failure - Update tests to match new hook semantics
Contributor
|
This looks implemented on current main by the newer Feishu processing-reaction lifecycle. Automated hermes-sweeper review evidence:
The implementation shape differs from this PR's |
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?
Implements a visual typing indicator for the Feishu platform by repurposing message reactions.
Feishu does not provide a native typing API. The base adapter's
_keep_typingloop callssend_typing()periodically while a response is being generated, and the processing path callsstop_typing()when the response finishes. InFeishuAdapter, those hooks were effectively no-ops, so Feishu users had no visual feedback that their message was being processed.This patch adds a minimal reaction-based implementation for Feishu. When processing starts, the adapter adds a
Typingreaction to the user's inbound message and stores the returnedreaction_id. When processing completes, it deletes that tracked reaction by ID. The patch also records the sourcemessage_idonly for real inbound message events, so synthetic reaction/card events do not overwrite the typing target.Related Issue
No existing issue — this is a gap in the Feishu adapter confirmed through production testing.
This PR is the slimmed-down resubmission of #6890. It keeps the same core reaction-tracking approach, but removes the extra env/config surface and narrows the tests to the minimal typing lifecycle and inbound-message tracking behavior.
Related upstream context:
stop_typingfixType of Change
Changes Made
gateway/platforms/feishu.py_typing_stateto track the sourcemessage_idand createdreaction_idsend_typing()by creating aTypingreaction on the tracked inbound messagestop_typing()by deleting the tracked reaction and clearing state_handle_message_with_guards()so only real inbound messages seed typing statetests/gateway/test_feishu.pyHow to Test
Typingreaction appear on the inbound message while the agent is processing.Typingreaction is removed.python -m pytest tests/gateway/test_feishu.py -v -o addopts=python -m pytest tests/gateway/test_feishu.py -k "typing or guards or ack_reaction" -v -o addopts=python -m py_compile gateway/platforms/feishu.py tests/gateway/test_feishu.pyChecklist
Design Notes
Why reactions?
Feishu's bot API does not expose a native typing endpoint. Reactions are the available in-product feedback mechanism for a bot message workflow.
Why track
reaction_id?Deleting the exact created reaction is simpler and more reliable than listing reactions and trying to rediscover the right entry later.
Why guard against synthetic events?
Feishu reaction and card callbacks are routed as synthetic events in the adapter. Those events should not change the source message used by the typing lifecycle.