fix(gateway): gate stream commentary reply-to on platforms that need it
Discord interim commentary was replying to the user's trigger message on
every update (66fa6e41c4 added reply_to unconditionally for Buzz). Discord
uses native thread_id; only Buzz/Slack/Mattermost/Feishu need reply-to
anchoring for threading.
- Stream consumer _send_commentary checks adapter.platform.value
- Passes reply_to only for buzz/slack/mattermost/feishu
- Discord/Telegram commentary posts flat or threads via metadata
This commit is contained in:
@@ -2714,10 +2714,16 @@ class GatewayStreamConsumer:
|
||||
# duplicate (live finding, 2026-08-16 canary).
|
||||
_md = self._metadata_for_send(final=False) or {}
|
||||
_md["_interim_send"] = True
|
||||
# Only pass reply_to for platforms that use reply-anchoring for
|
||||
# threading. Discord/Telegram use native thread_id in metadata;
|
||||
# passing reply_to on every commentary creates reply spam.
|
||||
_plat = getattr(getattr(self.adapter, "platform", None), "value", None)
|
||||
_platform_name = str(_plat or getattr(self.adapter, "name", "")).lower()
|
||||
_needs_reply_anchor = _platform_name in ("buzz", "slack", "mattermost", "feishu")
|
||||
result = await self.adapter.send(
|
||||
chat_id=self.chat_id,
|
||||
content=text,
|
||||
reply_to=self._initial_reply_to_id,
|
||||
reply_to=self._initial_reply_to_id if _needs_reply_anchor else None,
|
||||
metadata=_md,
|
||||
)
|
||||
# Note: do NOT set _already_sent = True here.
|
||||
|
||||
Reference in New Issue
Block a user