Reduce indexing overhead and repair agent search and child recovery

This commit is contained in:
2026-09-14 16:25:49 -05:00
parent 81b4c78b61
commit 506dc5b225
38 changed files with 1941 additions and 218 deletions
+2 -1
View File
@@ -21,7 +21,7 @@ use instant::Instant;
#[cfg(not(target_family = "wasm"))]
use crate::ai::agent::SearchCodebaseFailureReason;
use crate::ai::agent::{AIAgentActionId, SearchCodebaseResult};
use crate::ai::agent::{AIAgentActionId, SearchCodebaseResult, MAX_SEARCH_CODEBASE_FILES};
use crate::ai::blocklist::SessionContext;
#[cfg(any(not(feature = "local_fs"), target_family = "wasm"))]
use crate::ai::get_relevant_files::api::{FileContext as FileContextRequest, GetRelevantFiles};
@@ -362,6 +362,7 @@ impl GetRelevantFilesController {
.search(directory, &query, partial_path_segments.map(Vec::as_slice))
.map_err(|error| LocalIndexUnavailable(error.to_string()))?
.into_iter()
.take(MAX_SEARCH_CODEBASE_FILES)
.map(|hit| CodeContextLocation::WholeFile(hit.path))
.collect();
let file_paths = locations