From ceb8234a3062d348cb6eaceb6f34445e29139c31 Mon Sep 17 00:00:00 2001 From: xiaoxixi Date: Fri, 8 May 2026 16:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E6=B8=A0=E9=81=93=E5=89=A5?= =?UTF-8?q?=E7=A6=BB=E6=80=9D=E7=BB=B4=E9=93=BE=E5=86=85=E5=AE=B9=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/channels/feishu.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/channels/feishu.rs b/src/channels/feishu.rs index b008b23..e328b5f 100644 --- a/src/channels/feishu.rs +++ b/src/channels/feishu.rs @@ -1620,6 +1620,15 @@ impl Default for MdPatterns { } impl FeishuChannel { + fn strip_thinking_tags(content: &str) -> String { + use std::sync::LazyLock; + static THINK_RE: LazyLock = LazyLock::new(|| { + Regex::new(r"(?s).*?").unwrap() + }); + let stripped = THINK_RE.replace_all(content, ""); + stripped.trim().to_string() + } + /// Determine the optimal Feishu message format for content. fn detect_msg_format(content: &str) -> MsgFormat { let patterns = MdPatterns::new(); @@ -2075,6 +2084,10 @@ impl Channel for FeishuChannel { } async fn send(&self, msg: OutboundMessage) -> Result<(), ChannelError> { + let msg = OutboundMessage { + content: Self::strip_thinking_tags(&msg.content), + ..msg + }; let receive_id = if msg.chat_id.starts_with("oc_") { &msg.chat_id } else { &msg.reply_to.as_ref().unwrap_or(&msg.chat_id) }; let receive_id_type = if msg.chat_id.starts_with("oc_") { "chat_id" } else { "open_id" };