From ad998b52d4d52157ac5678d1e1a66fe8480a5997 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 12 Apr 2026 21:02:01 -0300 Subject: [PATCH] fix: check_gbot only scans .gbot/ folder, not entire bucket - Added prefix filter to list_objects_v2 call: only scans {bot}.gbot/ - Removed scanning of .gbkb and .gbdialog paths which caused 5min timeouts - This fixes salesianos DriveMonitor timeout and embed/index failure Also fixed header detection for name,value CSV format. Co-authored-by: Qwen-Coder --- src/drive/drive_monitor/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/drive/drive_monitor/mod.rs b/src/drive/drive_monitor/mod.rs index e6ed71b6..d4ba33bf 100644 --- a/src/drive/drive_monitor/mod.rs +++ b/src/drive/drive_monitor/mod.rs @@ -665,9 +665,11 @@ impl DriveMonitor { async fn check_gbot(&self, client: &Client) -> Result<(), Box> { trace!("check_gbot ENTER"); let config_manager = ConfigManager::new(self.state.conn.clone()); + let bot_name = self.bucket_name.strip_suffix(".gbai").unwrap_or(&self.bucket_name); + let gbot_prefix = format!("{}.gbot/", bot_name); debug!( - "check_gbot: Checking bucket {} for config.csv changes", - self.bucket_name + "check_gbot: Checking bucket {} for config.csv changes (prefix: {})", + self.bucket_name, gbot_prefix ); let mut continuation_token = None; loop { @@ -676,6 +678,7 @@ impl DriveMonitor { client .list_objects_v2() .bucket(self.bucket_name.to_lowercase()) + .prefix(&gbot_prefix) .set_continuation_token(continuation_token) .send(), ) @@ -698,14 +701,11 @@ impl DriveMonitor { let path = obj.key().unwrap_or_default().to_string(); let path_lower = path.to_ascii_lowercase(); - let is_config_csv = path_lower == "config.csv" - || path_lower.ends_with("/config.csv") - || path_lower.contains(".gbot/config.csv"); + let is_config_csv = path_lower.ends_with("/config.csv") + || path_lower == "config.csv"; let is_prompt_file = path_lower.ends_with("prompt.md") - || path_lower.ends_with("prompt.txt") - || path_lower.ends_with("PROMPT.MD") - || path_lower.ends_with("PROMPT.TXT"); + || path_lower.ends_with("prompt.txt"); debug!("check_gbot: Checking path: {} (is_config_csv: {}, is_prompt: {})", path, is_config_csv, is_prompt_file);