feat(feishu): add reaction event support (created/deleted)#16716
Merged
Takhoffman merged 4 commits intoopenclaw:mainfrom Feb 28, 2026
Merged
feat(feishu): add reaction event support (created/deleted)#16716Takhoffman merged 4 commits intoopenclaw:mainfrom
Takhoffman merged 4 commits intoopenclaw:mainfrom
Conversation
0ab7469 to
80d4b32
Compare
bfc1ccb to
f92900f
Compare
b1e1384 to
5c7677c
Compare
eef3ca3 to
6e3f4f1
Compare
Register im.message.reaction.created_v1 and im.message.reaction.deleted_v1 event handlers in the Feishu monitor, enabling bots to receive and respond to emoji reactions on messages. What this does: - Adds reaction event handlers to the EventDispatcher registration - Routes reaction events as synthetic inbound messages through the standard handleFeishuMessage pipeline, ensuring the agent gets a dedicated turn to process each reaction and respond appropriately - Filters out bot self-reactions (by operator_type and open_id), typing indicator emoji, and reaction-removed events - Uses crypto.randomUUID() for synthetic message IDs to prevent dedup collision when multiple reactions arrive within the same millisecond Design decisions: - Synthetic messages over system events: Reactions are dispatched as synthetic text messages through handleFeishuMessage rather than enqueueSystemEvent. This ensures the agent receives a dedicated turn to process each reaction (system events are passive and may be merged/delayed). - DM routing for all reactions: All reactions are routed as p2p messages via the sender's open_id. Feishu DM chat_ids also use 'oc_' prefix, so we cannot distinguish group vs DM by prefix alone. This avoids group allowlist issues and works correctly for the common case. - Fire-and-forget in webhook mode: Reaction handlers respect the fireAndForget flag to avoid blocking the HTTP response. Limitations: - Group chat reactions are routed to the sender's DM session rather than the group session. This works for single-agent setups but may need refinement for multi-agent configurations. Note: Users must subscribe to im.message.reaction.created_v1 (and optionally im.message.reaction.deleted_v1) in their Feishu app console for this to work.
Previously, the reaction event handler dispatched synthetic messages for ALL reactions a user made, including reactions on other people's messages in unrelated chats. This caused the agent to receive spurious notifications and respond inappropriately. Now the handler fetches the reacted message via getMessageFeishu and verifies that the message was sent by the bot before creating a synthetic event. Reactions on non-bot messages are silently dropped with a debug log. If the reacted message cannot be fetched (e.g. deleted message, permission error), the reaction is also skipped to avoid routing potentially irrelevant events to the agent. When botOpenId is not available (e.g. probe failed at startup), the sender check is skipped to maintain backward compatibility.
f1459ba to
8ba4efa
Compare
Contributor
|
PR #16716 - feat(feishu): add reaction event support (created/deleted) (#16716) Merged via squash.
Thanks @schumilin! |
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 4b54d39)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 4b54d39)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 4b54d39)
vincentkoc
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
vincentkoc
pushed a commit
to rylena/rylen-openclaw
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
newtontech
pushed a commit
to newtontech/openclaw-fork
that referenced
this pull request
Feb 28, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 8241145) # Conflicts: # extensions/feishu/src/monitor.ts
ansh
pushed a commit
to vibecode/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
safzanpirani
pushed a commit
to safzanpirani/clawdbot
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
venjiang
pushed a commit
to venjiang/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 8241145) # Conflicts: # extensions/feishu/src/monitor.ts
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
eminemead
pushed a commit
to eminemead/evi
that referenced
this pull request
Mar 3, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 8241145)
sachinkundu
pushed a commit
to sachinkundu/openclaw
that referenced
this pull request
Mar 6, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…16716) thanks @schumilin Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: schumilin <2003498+schumilin@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
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.
Why this matters
In Feishu (and Lark), emoji reactions are a core part of how people communicate — they're used constantly to acknowledge messages, express agreement, or give quick feedback without interrupting the conversation flow. This is especially true in Feishu&Lark workplace culture where a 👍 or a +1 (meaning "I agree") carries real conversational weight.
Right now, OpenClaw's Feishu plugin cannot receive reaction events at all. When a user reacts to the bot's message, nothing happens — the bot is blind to it. This makes the bot feel unresponsive and disconnected from the natural rhythm of Feishu conversations.
The infrastructure is already 90% there:
reactions.tshas full CRUD (addReactionFeishu,removeReactionFeishu,listReactionsFeishu)typing.tsuses the reaction API for typing indicators (proving the pipeline works)channel.tsdeclarescapabilities.reactions: trueThe only missing piece is registering the inbound event handler in
monitor.ts. This PR closes that gap.What this does
im.message.reaction.created_v1andim.message.reaction.deleted_v1event handlers in the Feishu EventDispatcherhandleFeishuMessage, giving the agent a dedicated turn to process each reaction and respond (e.g., react back)operator_type), typing indicator emoji, and reaction-removed eventsChanges
extensions/feishu/src/monitor.ts(~130 lines added):FeishuReactionEventtype definition matching the Feishu API schemahandleReactionEvent()— processes reaction events with proper filtering and routingregisterEventHandlers()Design decisions
Synthetic messages over system events
We initially tried
enqueueSystemEvent()(matching the Slack plugin pattern), but found that system events are passive — they only surface during the next agent turn and may be merged or delayed. For Feishu's interactive reaction culture, the agent needs a dedicated turn to process each reaction and respond in kind. Synthetic messages throughhandleFeishuMessageachieve this.DM routing for all reactions
Feishu's DM
chat_idalso uses theoc_prefix (unlike most platforms), making it impossible to distinguish DM vs group by prefix alone. To avoid group allowlist issues, all reactions are routed as p2p messages via the sender'sopen_id. This works correctly for single-agent setups. Group-specific session routing can be refined in a follow-up.Safety filters
operator_type === "app"andopen_idmatchTypingemoji) excluded — used internallySetup required
Users must subscribe to
im.message.reaction.created_v1in their Feishu Open Platform app console (Events & Callbacks).Tested
Dogfooded on a live Feishu bot:
Greptile Summary
Adds support for Feishu reaction events (
im.message.reaction.created_v1andim.message.reaction.deleted_v1) by registering handlers in the event dispatcher. Reactions are dispatched as synthetic DM messages throughhandleFeishuMessage, giving the agent a dedicated turn to process and respond to each reaction. The implementation includes proper filtering for bot self-reactions, typing indicator emoji, and reaction-removed events.Key changes:
FeishuReactionEventtype definition matching Feishu API schemahandleReactionEvent()function with filtering logic and synthetic message creationregisterEventHandlers()open_idto avoid group allowlist complexityNotes:
Confidence Score: 4/5
Last reviewed commit: 80d4b32
(2/5) Greptile learns from your feedback when you react with thumbs up/down!