From 9b6851c4f5c7a97ad932aa7161b46e0dfb05516f Mon Sep 17 00:00:00 2001 From: Dhanji Prasanna Date: Mon, 15 Sep 2025 09:22:21 +1000 Subject: [PATCH] removed some extra logging --- crates/g3-core/src/lib.rs | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/crates/g3-core/src/lib.rs b/crates/g3-core/src/lib.rs index cc2d84a..136dfba 100644 --- a/crates/g3-core/src/lib.rs +++ b/crates/g3-core/src/lib.rs @@ -54,18 +54,16 @@ impl StreamingToolParser { // Look for JSON tool call pattern - check both raw JSON and inside code blocks // Also handle malformed patterns and whitespace variations let patterns = [ - r#"{"tool":"#, // Normal pattern - r#"{ "tool":"#, // Pattern with space after opening brace - r#"{"tool" :"#, // Pattern with space before colon - r#"{ "tool" :"#, // Pattern with spaces around tool - r#"{"{""tool"":"#, // Malformed pattern with extra brace and doubled quotes - r#"{{""tool"":"#, // Alternative malformed pattern + r#"{"tool":"#, // Normal pattern + r#"{ "tool":"#, // Pattern with space after opening brace + r#"{"tool" :"#, // Pattern with space before colon + r#"{ "tool" :"#, // Pattern with spaces around tool + r#"{"{""tool"":"#, // Malformed pattern with extra brace and doubled quotes + r#"{{""tool"":"#, // Alternative malformed pattern ]; for pattern in &patterns { if let Some(pos) = self.buffer.rfind(pattern) { - info!("Found tool call pattern '{}' at position: {}", pattern, pos); - // Check if this is inside a code block let before_pos = &self.buffer[..pos]; let _code_block_count = before_pos.matches("```").count(); @@ -135,7 +133,6 @@ impl StreamingToolParser { if json_str.contains(r#""tool": "shell""#) { let fixed_json = fix_nested_quotes_in_shell_command(&json_str); if let Ok(tool_call) = serde_json::from_str::(&fixed_json) { - info!("Successfully parsed tool call after fixing nested quotes: {:?}", tool_call); // Reset parser state self.in_tool_call = false; self.tool_start_pos = None; @@ -648,7 +645,7 @@ The tool will execute immediately and you'll receive the result (success or erro fn generate_session_id(&self, description: &str) -> String { use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; - + // Clean and truncate the description for a readable filename let clean_description = description .chars() @@ -659,12 +656,12 @@ The tool will execute immediately and you'll receive the result (success or erro .collect::>() .join("_") .to_lowercase(); - + // Create a hash for uniqueness let mut hasher = DefaultHasher::new(); description.hash(&mut hasher); let hash = hasher.finish(); - + // Format: clean_description_hash format!("{}_{:x}", clean_description, hash) } @@ -699,8 +696,6 @@ The tool will execute immediately and you'll receive the result (success or erro Ok(json_content) => { if let Err(e) = fs::write(&filename, json_content) { error!("Failed to save context window to {}: {}", filename, e); - } else { - info!("Context window saved to {}", filename); } } Err(e) => { @@ -997,11 +992,6 @@ The tool will execute immediately and you'll receive the result (success or erro } // Continue the loop to start a new stream with updated context - info!( - "Starting new stream iteration {} with {} messages", - iteration_count, - request.messages.len() - ); } // If we exit the loop due to max iterations