#19105: fix(slack): suppress system events for bot's own reactions
channel: slack
size: XS
trusted-contributor
Cluster:
Slack Integration Enhancements
When the bot reacts to a message (e.g. acknowledgment), it triggers a 'reaction_added' event, causing a redundant System Event in the session history.
Fix: Filter out reaction events where the actor is the bot itself.
Recreated from #18714 with only the relevant file.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Filters out Slack reaction events (`reaction_added` / `reaction_removed`) where the actor is the bot itself, preventing redundant system events from being enqueued when the bot reacts to messages (e.g. acknowledgment emojis). The guard `event.user === ctx.botUserId` is added at the top of `handleReactionEvent`, before any API calls or side effects, which is the correct placement. Import ordering was also adjusted to place type imports before value imports.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — it adds a simple, well-placed guard clause with no risk of side effects.
- The change is minimal and targeted: a single early-return guard comparing `event.user` against the known `ctx.botUserId`. The `SlackReactionEvent` type defines `user` as `string | undefined`, and `ctx.botUserId` is a `string`, so the `===` comparison handles the `undefined` case correctly (no match). The guard is placed before any API calls or `enqueueSystemEvent`, avoiding unnecessary work. The import reordering is cosmetic only. No tests exist for this file, but the logic is straightforward enough that the risk is negligible.
- No files require special attention
<sub>Last reviewed commit: ef94f4d</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#6089: fix(slack): add reactionNotifications config check to reactions han...
by jontsai · 2026-02-01
77.0%
#9520: fix: ignore slack already_reacted
by bolismauro · 2026-02-05
75.7%
#7719: fix(slack): thread replies with @mentions dropped in requireMention...
by SocialNerd42069 · 2026-02-03
75.0%
#20479: fix(slack): keep replies flowing for oversized file uploads
by olyashok · 2026-02-19
73.6%
#17316: fix: ack reaction not removed when block streaming is enabled (Tele...
by czmathew · 2026-02-15
73.4%
#16716: feat(feishu): add reaction event support (created/deleted)
by schumilin · 2026-02-15
73.3%
#19567: Fix: tighten Slack multi-account event filtering via api_app_id
by TARS-Nolan · 2026-02-17
73.1%
#13590: fix(slack): remove ack reaction after tool-only replies
by alfongj-com · 2026-02-10
73.0%
#20152: fix(slack): allow app_mention events to bypass dedup cache
by nova-openclaw-cgk · 2026-02-18
72.8%
#2414: fix(slack): route DM replies to original channel, not App Home
by mbennett37 · 2026-01-26
72.7%