mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
fix: remove logs
This commit is contained in:
@@ -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::<Vec<_>>();
|
||||
|
||||
if item_types.is_empty() {
|
||||
"none".to_string()
|
||||
} else {
|
||||
item_types.join(",")
|
||||
}
|
||||
}
|
||||
|
||||
fn send_response(
|
||||
config: &WechatConfig,
|
||||
metadata: &OutboundMetadata,
|
||||
|
||||
Reference in New Issue
Block a user