#18408: fix(message): support react current alias and suppress leaked react errors
agents
size: S
Cluster:
Message Handling Improvements
Fixes #18154
## Problem
Two issues with `message react`:
1. React errors (e.g. invalid emoji, missing permissions) leak as visible Discord messages instead of being handled silently
2. No shortcut to react to the current/triggering message — users must manually pass message IDs
## Changes
- **message-action-params.ts**: Added `readCurrentMessageIdAlias()` — resolves `messageId: "current"` to the triggering message's ID from tool context
- **message-action-runner.ts**: Maps `messageId=current` before dispatching to channel plugin
- **payloads.ts**: Added `isSuppressedSideEffectToolError()` — suppresses react failures from user-visible output (still logged internally)
- **Tests**: Added unit tests for both current-alias resolution and error suppression
## Tests
All 27 unit tests pass.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR fixes two issues with the `message react` action: (1) adds a `"current"` alias for `messageId` that resolves to the triggering message's ID from tool context, and (2) suppresses react failure errors from user-visible output while still logging them internally.
- **`readCurrentMessageIdAlias`** in `message-action-params.ts` cleanly resolves `messageId: "current"` to the actual message ID from `currentThreadTs` in the tool context
- **`isSuppressedSideEffectToolError`** in `payloads.ts` prevents react errors (invalid emoji, missing permissions, etc.) from appearing as visible Discord messages to the user
- **Integration** in `message-action-runner.ts` hooks the alias resolution into the react action path, placed correctly after `applyTargetToParams`
- **Tests** cover the alias resolution and error suppression paths
- **Issue**: When `currentThreadTs` is not available (e.g., channels without `buildToolContext` or outside thread context), the `"current"` alias silently falls through as a literal string, which will fail at the API level and then be suppressed by the new error suppression — resulting in completely silent no-op behavior with no user feedback
<h3>Confidence Score: 3/5</h3>
- PR is mostly safe but has a silent failure mode when the "current" alias cannot be resolved
- The core logic is sound and well-tested for the happy path. The main concern is an edge case where the "current" alias cannot be resolved (when currentThreadTs is unavailable), resulting in a literal "current" string being passed to the channel API. Combined with the new error suppression, this creates a completely silent failure with no user feedback. The score reflects this unhandled edge case in an otherwise clean PR.
- Pay close attention to `src/infra/outbound/message-action-runner.ts` — the alias resolution fallback path when `currentThreadTs` is unavailable needs handling.
<sub>Last reviewed commit: 8f74619</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#18893: fix(message): use currentMessageId for react fallback and suppress ...
by teededung · 2026-02-17
85.7%
#20236: fix(telegram): make reaction handling soft-fail and message-id resi...
by PeterShanxin · 2026-02-18
79.4%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
78.6%
#23723: feat(message): improve send param ergonomics and actionable routing...
by SmithLabsLLC · 2026-02-22
77.4%
#21132: fix: allow message(action='read') in isolated/cron sessions + add H...
by matt-bedda · 2026-02-19
76.3%
#17552: fix(agents): suppress tool error warnings when assistant already re...
by AytuncYildizli · 2026-02-15
75.9%
#18466: fix: suppress recoverable mutating tool errors when agent already r...
by stijnhoste · 2026-02-16
75.6%
#9520: fix: ignore slack already_reacted
by bolismauro · 2026-02-05
75.6%
#20406: fix(slack): respect replyToMode when computing statusThreadTs in DMs
by QuinnYates · 2026-02-18
75.1%
#19235: fix(telegram): tool error warnings no longer overwrite streamed rep...
by gatewaybuddy · 2026-02-17
74.8%