From aedd076b8cf18f0423802a8e2272dd085c531b40 Mon Sep 17 00:00:00 2001 From: ychhabria Date: Mon, 23 Mar 2026 23:18:39 -0700 Subject: [PATCH] Raise standalone file search limit to 50 --- codex-rs/tui/src/file_search.rs | 5 +++++ codex-rs/tui_app_server/src/file_search.rs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/codex-rs/tui/src/file_search.rs b/codex-rs/tui/src/file_search.rs index 70ac98de11..d1aedc8efc 100644 --- a/codex-rs/tui/src/file_search.rs +++ b/codex-rs/tui/src/file_search.rs @@ -6,6 +6,7 @@ //! on every keystroke, and drops the session when the query becomes empty. use codex_file_search as file_search; +use std::num::NonZero; use std::path::PathBuf; use std::sync::Arc; use std::sync::Mutex; @@ -13,6 +14,8 @@ use std::sync::Mutex; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; +const FILE_SEARCH_LIMIT: usize = 50; + pub(crate) struct FileSearchManager { state: Arc>, search_dir: PathBuf, @@ -83,6 +86,8 @@ impl FileSearchManager { let session = file_search::create_session( vec![self.search_dir.clone()], file_search::FileSearchOptions { + #[expect(clippy::unwrap_used)] + limit: NonZero::new(FILE_SEARCH_LIMIT).unwrap(), compute_indices: true, ..Default::default() }, diff --git a/codex-rs/tui_app_server/src/file_search.rs b/codex-rs/tui_app_server/src/file_search.rs index 70ac98de11..d1aedc8efc 100644 --- a/codex-rs/tui_app_server/src/file_search.rs +++ b/codex-rs/tui_app_server/src/file_search.rs @@ -6,6 +6,7 @@ //! on every keystroke, and drops the session when the query becomes empty. use codex_file_search as file_search; +use std::num::NonZero; use std::path::PathBuf; use std::sync::Arc; use std::sync::Mutex; @@ -13,6 +14,8 @@ use std::sync::Mutex; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; +const FILE_SEARCH_LIMIT: usize = 50; + pub(crate) struct FileSearchManager { state: Arc>, search_dir: PathBuf, @@ -83,6 +86,8 @@ impl FileSearchManager { let session = file_search::create_session( vec![self.search_dir.clone()], file_search::FileSearchOptions { + #[expect(clippy::unwrap_used)] + limit: NonZero::new(FILE_SEARCH_LIMIT).unwrap(), compute_indices: true, ..Default::default() },