From 4b7be3f9eea76f70569694d1482251e524a86cc2 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Mon, 19 Jan 2026 21:51:08 +0530 Subject: [PATCH] Increase research tool timeout to 20 minutes The research tool often runs past 8 minutes due to web browsing and analysis. Increased its timeout to 20 minutes while keeping other tools at 8 minutes. Changes: - Tool timeout is now tool-specific (20 min for research, 8 min for others) - Timeout error message now shows the correct duration for each tool --- crates/g3-core/src/lib.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/g3-core/src/lib.rs b/crates/g3-core/src/lib.rs index 94dc420..7647c17 100644 --- a/crates/g3-core/src/lib.rs +++ b/crates/g3-core/src/lib.rs @@ -2174,9 +2174,14 @@ Skip if nothing new. Be brief."#; // Clone working_dir to avoid borrow checker issues let working_dir = self.working_dir.clone(); let exec_start = Instant::now(); - // Add 8-minute timeout for tool execution + // Tool execution timeout: 20 minutes for research, 8 minutes for others + let timeout_duration = if tool_call.tool == "research" { + Duration::from_secs(20 * 60) // 20 minutes for research + } else { + Duration::from_secs(8 * 60) // 8 minutes for other tools + }; let tool_result = match tokio::time::timeout( - Duration::from_secs(8 * 60), // 8 minutes + timeout_duration, // Use working_dir if set (from --codebase-fast-start) self.execute_tool_in_dir(&tool_call, working_dir.as_deref()), ) @@ -2184,8 +2189,12 @@ Skip if nothing new. Be brief."#; { Ok(result) => result?, Err(_) => { - warn!("Tool call {} timed out after 8 minutes", tool_call.tool); - "❌ Tool execution timed out after 8 minutes".to_string() + let timeout_mins = if tool_call.tool == "research" { 20 } else { 8 }; + warn!("Tool call {} timed out after {} minutes", tool_call.tool, timeout_mins); + format!( + "❌ Tool execution timed out after {} minutes", + timeout_mins + ) } }; let exec_duration = exec_start.elapsed();