From 452f98c1b4f8631a3f4e89cf3a3810f9e474f2df Mon Sep 17 00:00:00 2001 From: Coffee Date: Fri, 27 Mar 2026 15:19:27 +0800 Subject: [PATCH] fix: remove logs --- channels-src/wechat/src/lib.rs | 56 ---------------------------------- 1 file changed, 56 deletions(-) diff --git a/channels-src/wechat/src/lib.rs b/channels-src/wechat/src/lib.rs index 6cddebea..d95cfa2e 100644 --- a/channels-src/wechat/src/lib.rs +++ b/channels-src/wechat/src/lib.rs @@ -138,16 +138,6 @@ impl Guest for WechatChannel { let mut context_tokens_changed = false; for message in response.msgs { - log_channel( - channel_host::LogLevel::Info, - &format!( - "Received WeChat message: id={:?} from_user_id={:?} message_type={:?} item_types=[{}]", - message.message_id, - message.from_user_id, - message.message_type, - summarize_item_types(&message), - ), - ); if let Some(from_user_id) = message.from_user_id.as_deref() { if let Some(context_token) = message.context_token.as_deref() { let changed = context_tokens @@ -159,15 +149,6 @@ impl Guest for WechatChannel { } match incoming_bundle_from_message(&config, message) { Ok(Some(bundle)) => { - log_channel( - channel_host::LogLevel::Info, - &format!( - "Mapped WeChat message into bundle: from_user_id={} text_len={} attachment_count={}", - bundle.from_user_id, - bundle.text.trim().chars().count(), - bundle.attachments.len(), - ), - ); let emitted = process_incoming_bundle( &mut pending_inbound, bundle, @@ -190,13 +171,6 @@ impl Guest for WechatChannel { for key in carried_pending_keys { if let Some(bundle) = pending_inbound.remove(&key) { pending_inbound_changed = true; - log_channel( - channel_host::LogLevel::Info, - &format!( - "Flushing buffered WeChat attachment-only message for {} after waiting one poll cycle", - bundle.from_user_id - ), - ); emit_buffered_bundle(bundle); } } @@ -388,15 +362,6 @@ fn process_incoming_bundle( } fn emit_buffered_bundle(bundle: PendingInboundBundle) { - log_channel( - channel_host::LogLevel::Info, - &format!( - "Emitting WeChat bundle to agent: from_user_id={} text_len={} attachment_count={}", - bundle.from_user_id, - bundle.text.trim().chars().count(), - bundle.attachments.len(), - ), - ); let metadata = json!({ "from_user_id": bundle.from_user_id, "to_user_id": bundle.to_user_id, @@ -441,27 +406,6 @@ fn merge_text(existing: &str, incoming: &str) -> String { } } -fn summarize_item_types(message: &WechatMessage) -> String { - let item_types = message - .item_list - .iter() - .map(|item| match item.r#type { - Some(MESSAGE_ITEM_TEXT) => "text".to_string(), - Some(crate::types::MESSAGE_ITEM_IMAGE) => "image".to_string(), - Some(crate::types::MESSAGE_ITEM_VOICE) => "voice".to_string(), - Some(crate::types::MESSAGE_ITEM_FILE) => "file".to_string(), - Some(other) => format!("unknown:{other}"), - None => "missing".to_string(), - }) - .collect::>(); - - if item_types.is_empty() { - "none".to_string() - } else { - item_types.join(",") - } -} - fn send_response( config: &WechatConfig, metadata: &OutboundMetadata,