From 6468588f581038c194d68e91e273872538ecd991 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Mon, 13 Apr 2026 22:51:29 -0300 Subject: [PATCH] fix: remove LLM streaming lock that caused deadlocks --- src/core/bot/mod.rs | 13 +++++++------ src/drive/drive_monitor/mod.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/core/bot/mod.rs b/src/core/bot/mod.rs index b3e04176..6292c054 100644 --- a/src/core/bot/mod.rs +++ b/src/core/bot/mod.rs @@ -10,7 +10,7 @@ use tool_executor::ToolExecutor; use crate::core::config::ConfigManager; #[cfg(feature = "drive")] -use crate::drive::drive_monitor::{DriveMonitor, set_llm_streaming}; +use crate::drive::drive_monitor::{DriveMonitor}; #[cfg(feature = "llm")] use crate::llm::llm_models; #[cfg(feature = "llm")] @@ -811,9 +811,9 @@ impl BotOrchestrator { // Clone messages for the async task let messages_clone = messages.clone(); - // Set flag to prevent DriveMonitor PDF downloads during LLM streaming - #[cfg(feature = "drive")] - set_llm_streaming(true); + // REMOVED: LLM streaming lock was causing deadlocks + // #[cfg(feature = "drive")] + // set_llm_streaming(true); let stream_tx_clone = stream_tx.clone(); tokio::spawn(async move { @@ -823,8 +823,9 @@ impl BotOrchestrator { { error!("LLM streaming error: {}", e); } - #[cfg(feature = "drive")] - set_llm_streaming(false); + // REMOVED: LLM streaming lock was causing deadlocks + // #[cfg(feature = "drive")] + // set_llm_streaming(false); }); let mut full_response = String::new(); diff --git a/src/drive/drive_monitor/mod.rs b/src/drive/drive_monitor/mod.rs index bde15028..3ba08f26 100644 --- a/src/drive/drive_monitor/mod.rs +++ b/src/drive/drive_monitor/mod.rs @@ -1685,13 +1685,13 @@ let file_state = FileState { files_processed += 1; debug!("[GBKB] Queue size: {}/10", files_to_process.len()); - // Skip downloads if LLM is actively streaming to prevent deadlock - #[cfg(any(feature = "research", feature = "llm"))] - if is_llm_streaming() { - debug!("[GBKB] Skipping download - LLM is streaming, will retry later"); - files_to_process.clear(); - break; - } + // REMOVED: Skip downloads if LLM is actively streaming - was causing deadlocks + // #[cfg(any(feature = "research", feature = "llm"))] + // if is_llm_streaming() { + // debug!("[GBKB] Skipping download - LLM is streaming, will retry later"); + // files_to_process.clear(); + // break; + // } if files_to_process.len() >= 10 { debug!("[GBKB] Downloading batch of {} files", files_to_process.len());