From c9ac1ccc27424df92bab2787bd028d4be872800d Mon Sep 17 00:00:00 2001 From: ychhabria Date: Tue, 24 Mar 2026 03:08:29 -0700 Subject: [PATCH] Tune file search defaults from eval sweep --- codex-rs/app-server/src/fuzzy_file_search.rs | 4 ++-- codex-rs/file-search/src/cli.rs | 9 ++++----- codex-rs/file-search/src/lib.rs | 4 ++-- codex-rs/tui/src/file_search.rs | 2 +- codex-rs/tui_app_server/src/file_search.rs | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/codex-rs/app-server/src/fuzzy_file_search.rs b/codex-rs/app-server/src/fuzzy_file_search.rs index f8cd61e3ad..75eedb6bdb 100644 --- a/codex-rs/app-server/src/fuzzy_file_search.rs +++ b/codex-rs/app-server/src/fuzzy_file_search.rs @@ -15,8 +15,8 @@ use tracing::warn; use crate::outgoing_message::OutgoingMessageSender; -const MATCH_LIMIT: usize = 50; -const MAX_THREADS: usize = 12; +const MATCH_LIMIT: usize = 100; +const MAX_THREADS: usize = 8; pub(crate) async fn run_fuzzy_file_search( query: String, diff --git a/codex-rs/file-search/src/cli.rs b/codex-rs/file-search/src/cli.rs index e3394f92da..5315b79830 100644 --- a/codex-rs/file-search/src/cli.rs +++ b/codex-rs/file-search/src/cli.rs @@ -13,7 +13,7 @@ pub struct Cli { pub json: bool, /// Maximum number of results to return. - #[clap(long, short = 'l', default_value = "64")] + #[clap(long, short = 'l', default_value = "100")] pub limit: NonZero, /// Directory to search. @@ -25,12 +25,11 @@ pub struct Cli { pub compute_indices: bool, // While it is common to default to the number of logical CPUs when creating - // a thread pool, empirically, the I/O of the filetree traversal offers - // limited parallelism and is the bottleneck, so using a smaller number of - // threads is more efficient. (Empirically, using more than 2 threads doesn't seem to provide much benefit.) + // a thread pool, empirically, 8 worker threads was the fastest setting in + // local monorepo evals among the best-performing quality tiers. // /// Number of worker threads to use. - #[clap(long, default_value = "2")] + #[clap(long, default_value = "8")] pub threads: NonZero, /// Exclude patterns diff --git a/codex-rs/file-search/src/lib.rs b/codex-rs/file-search/src/lib.rs index 64f4c19f73..2b998ca3d7 100644 --- a/codex-rs/file-search/src/lib.rs +++ b/codex-rs/file-search/src/lib.rs @@ -116,10 +116,10 @@ impl Default for FileSearchOptions { fn default() -> Self { Self { #[expect(clippy::unwrap_used)] - limit: NonZero::new(20).unwrap(), + limit: NonZero::new(100).unwrap(), exclude: Vec::new(), #[expect(clippy::unwrap_used)] - threads: NonZero::new(2).unwrap(), + threads: NonZero::new(8).unwrap(), compute_indices: false, respect_gitignore: true, } diff --git a/codex-rs/tui/src/file_search.rs b/codex-rs/tui/src/file_search.rs index d1aedc8efc..42a48ecc9c 100644 --- a/codex-rs/tui/src/file_search.rs +++ b/codex-rs/tui/src/file_search.rs @@ -14,7 +14,7 @@ use std::sync::Mutex; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; -const FILE_SEARCH_LIMIT: usize = 50; +const FILE_SEARCH_LIMIT: usize = 100; pub(crate) struct FileSearchManager { state: Arc>, diff --git a/codex-rs/tui_app_server/src/file_search.rs b/codex-rs/tui_app_server/src/file_search.rs index d1aedc8efc..42a48ecc9c 100644 --- a/codex-rs/tui_app_server/src/file_search.rs +++ b/codex-rs/tui_app_server/src/file_search.rs @@ -14,7 +14,7 @@ use std::sync::Mutex; use crate::app_event::AppEvent; use crate::app_event_sender::AppEventSender; -const FILE_SEARCH_LIMIT: usize = 50; +const FILE_SEARCH_LIMIT: usize = 100; pub(crate) struct FileSearchManager { state: Arc>,