feat(channels): add send_progress option to control progress message delivery

Add a boolean config option `channels.sendProgress` (default: false) to
control whether progress messages (marked with `_progress` metadata) are
sent to chat channels. When disabled, progress messages are filtered
out in the outbound dispatcher.
This commit is contained in:
Yingwen Luo-LUOYW
2026-02-22 23:13:09 +08:00
parent fff6207c6b
commit 0c412b3728
2 changed files with 4 additions and 0 deletions

View File

@@ -193,6 +193,9 @@ class ChannelManager:
timeout=1.0 timeout=1.0
) )
if msg.metadata.get("_progress") and not self.config.channels.send_progress:
continue
channel = self.channels.get(msg.channel) channel = self.channels.get(msg.channel)
if channel: if channel:
try: try:

View File

@@ -168,6 +168,7 @@ class QQConfig(Base):
class ChannelsConfig(Base): class ChannelsConfig(Base):
"""Configuration for chat channels.""" """Configuration for chat channels."""
send_progress: bool = False
whatsapp: WhatsAppConfig = Field(default_factory=WhatsAppConfig) whatsapp: WhatsAppConfig = Field(default_factory=WhatsAppConfig)
telegram: TelegramConfig = Field(default_factory=TelegramConfig) telegram: TelegramConfig = Field(default_factory=TelegramConfig)
discord: DiscordConfig = Field(default_factory=DiscordConfig) discord: DiscordConfig = Field(default_factory=DiscordConfig)