fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam#31580
Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom Mar 3, 2026
Conversation
Contributor
Greptile SummaryThis PR fixes notification spam in Feishu by preventing unnecessary typing indicator re-adds. The fix adds a guard condition that skips the keepalive re-add when a reaction already exists ( Key Changes:
Technical Analysis:
Confidence Score: 5/5
Last reviewed commit: 3388fe6 |
…ication spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660
3388fe6 to
7ca7ab0
Compare
Contributor
|
Merged after rebase + verification. Verification run:
Notes:
|
dawi369
pushed a commit
to dawi369/davis
that referenced
this pull request
Mar 3, 2026
…ication spam (openclaw#31580) * fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660 * Changelog: note Feishu typing keepalive suppression --------- Co-authored-by: yuxh1996 <yuxh1996@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
OWALabuy
pushed a commit
to kcinzgg/openclaw
that referenced
this pull request
Mar 4, 2026
…ication spam (openclaw#31580) * fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660 * Changelog: note Feishu typing keepalive suppression --------- Co-authored-by: yuxh1996 <yuxh1996@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
smthfoxy
pushed a commit
to smthfoxy/openclaw
that referenced
this pull request
Mar 4, 2026
…g re-adds The openclaw#31580 fix correctly avoided re-adding typing reactions (which triggered duplicate push notifications per openclaw#28660). However, skipping re-adds entirely caused the Feishu client to stop displaying the typing animation after a short period, even though the reaction remained on the message. Fix: on keepalive ticks, remove the existing reaction first, then re-add it. This refreshes the visual typing indicator without triggering duplicate notification pushes (since the reaction is removed before being re-added, Feishu treats it as a new reaction rather than a duplicate). Add regression test: verify that the second onReplyStart call (keepalive) triggers a remove-then-add cycle instead of being skipped.
smthfoxy
pushed a commit
to smthfoxy/openclaw
that referenced
this pull request
Mar 4, 2026
…g re-adds The openclaw#31580 fix correctly avoided re-adding typing reactions (which triggered duplicate push notifications per openclaw#28660). However, skipping re-adds entirely caused the Feishu client to stop displaying the typing animation after a short period, even though the reaction remained on the message. Fix: on keepalive ticks, remove the existing reaction first, then re-add it. This refreshes the visual typing indicator without triggering duplicate notification pushes (since the reaction is removed before being re-added, Feishu treats it as a new reaction rather than a duplicate). Add regression test: verify that the second onReplyStart call (keepalive) triggers a remove-then-add cycle instead of being skipped.
smthfoxy
pushed a commit
to smthfoxy/openclaw
that referenced
this pull request
Mar 4, 2026
…g re-adds The openclaw#31580 fix correctly avoided re-adding typing reactions (which triggered duplicate push notifications per openclaw#28660). However, skipping re-adds entirely caused the Feishu client to stop displaying the typing animation after a short period, even though the reaction remained on the message. Fix: on keepalive ticks, remove the existing reaction first, then re-add it. This refreshes the visual typing indicator without triggering duplicate notification pushes (since the reaction is removed before being re-added, Feishu treats it as a new reaction rather than a duplicate). Add regression test: verify that the second onReplyStart call (keepalive) triggers a remove-then-add cycle instead of being skipped.
smthfoxy
pushed a commit
to smthfoxy/openclaw
that referenced
this pull request
Mar 4, 2026
…g re-adds The openclaw#31580 fix correctly avoided re-adding typing reactions (which triggered duplicate push notifications per openclaw#28660). However, skipping re-adds entirely caused the Feishu client to stop displaying the typing animation after a short period, even though the reaction remained on the message. Fix: on keepalive ticks, remove the existing reaction first, then re-add it. This refreshes the visual typing indicator without triggering duplicate notification pushes (since the reaction is removed before being re-added, Feishu treats it as a new reaction rather than a duplicate). Race safety: use a `typingStopped` flag to prevent start() from restoring state after stop() has run. After each async gap in start(), recheck the flag and clean up any freshly-added reaction if stop() fired concurrently. This closes the window where an orphaned reaction could stick on the message permanently. Add regression tests: - Verify keepalive triggers remove-then-add cycle - Verify stop()-during-add cleans up the orphaned reaction - Verify start() is a no-op once stop() has been called
smthfoxy
pushed a commit
to smthfoxy/openclaw
that referenced
this pull request
Mar 4, 2026
…g re-adds The openclaw#31580 fix correctly avoided re-adding typing reactions (which triggered duplicate push notifications per openclaw#28660). However, skipping re-adds entirely caused the Feishu client to stop displaying the typing animation after a short period, even though the reaction remained on the message. Fix: on keepalive ticks, remove the existing reaction first, then re-add it. This refreshes the visual typing indicator without triggering duplicate notification pushes (since the reaction is removed before being re-added, Feishu treats it as a new reaction rather than a duplicate). Race safety: - `typingStopped` flag prevents start() from restoring state after stop(). - `startChain` promise serializes concurrent start() calls so fire-and-forget keepalive ticks don't interleave and orphan reactions under high latency. - stop() awaits startChain before cleanup, closing the window where an in-flight add could outlive the stop. - After each async gap in start(), recheck typingStopped and clean up any freshly-added reaction if stop() fired concurrently. Add regression tests: - Verify keepalive triggers remove-then-add cycle - Verify stop()-during-add cleans up the orphaned reaction - Verify start() is a no-op once stop() has been called
AytuncYildizli
pushed a commit
to AytuncYildizli/openclaw
that referenced
this pull request
Mar 4, 2026
…ication spam (openclaw#31580) * fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660 * Changelog: note Feishu typing keepalive suppression --------- Co-authored-by: yuxh1996 <yuxh1996@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
…ication spam (openclaw#31580) * fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660 * Changelog: note Feishu typing keepalive suppression --------- Co-authored-by: yuxh1996 <yuxh1996@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.
Problem
The typing keepalive loop calls
addTypingIndicator()every 3 seconds, which makes a freshmessageReaction.createAPI call each time. Feishu treats each re-add as a new reaction event and fires a push notification to the user.This means the longer a response takes (e.g., during tool calls), the more duplicate notifications the user receives — one every 3 seconds.
Root Cause
Unlike Telegram/Discord where typing status expires after ~5 seconds and needs refreshing, Feishu reactions persist until explicitly removed via
messageReaction.delete. The keepalive mechanism is unnecessary for Feishu and actively harmful.Fix
Skip the keepalive re-add in the reply dispatcher's
start()callback when a reaction already exists (typingState.reactionIdis set). The initial reaction is still added on first call, and properly removed viastop()when the reply completes.Changes
extensions/feishu/src/reply-dispatcher.ts: Guard keepalive re-adds withtypingState?.reactionIdcheckCloses #28660