diff --git a/crates/goose/src/providers/utils.rs b/crates/goose/src/providers/utils.rs index 8fe23f08..77775041 100644 --- a/crates/goose/src/providers/utils.rs +++ b/crates/goose/src/providers/utils.rs @@ -455,7 +455,7 @@ pub struct RequestLog { temp_path: PathBuf, } -const LOGS_TO_KEEP: usize = 10; +pub const LOGS_TO_KEEP: usize = 10; impl RequestLog { pub fn start(model_config: &ModelConfig, payload: &Payload) -> Result diff --git a/crates/goose/src/session/diagnostics.rs b/crates/goose/src/session/diagnostics.rs index 1e807e01..a22bff1a 100644 --- a/crates/goose/src/session/diagnostics.rs +++ b/crates/goose/src/session/diagnostics.rs @@ -1,4 +1,5 @@ use crate::config::paths::Paths; +use crate::providers::utils::LOGS_TO_KEEP; use crate::session::SessionManager; use std::fs::{self}; use std::io::Cursor; @@ -36,7 +37,7 @@ pub async fn generate_diagnostics(session_id: &str) -> anyhow::Result> { log_files.sort_by_key(|e| e.metadata().ok().and_then(|m| m.modified().ok())); - for entry in log_files.iter().rev().take(3) { + for entry in log_files.iter().rev().take(LOGS_TO_KEEP) { let path = entry.path(); let name = path.file_name().unwrap().to_str().unwrap(); zip.start_file(format!("logs/{}", name), options)?;