From 5f2bd3342ffd8524def5fde93f079054b5e7042e Mon Sep 17 00:00:00 2001 From: jif Date: Tue, 24 Nov 2026 13:59:28 +0000 Subject: [PATCH] Remove unused SQLite thread-listing helpers from rollout (#63652) Delete `list_archived_threads_from_state_db` and the `list_thread_ids_db` helper for parity checks. GitOrigin-RevId: cfcd7b24dd0dfbc97c7b245ef00390c0aded872b --- codex-rs/rollout/src/recorder.rs | 33 ------------------- codex-rs/rollout/src/state_db.rs | 56 -------------------------------- 2 files changed, 89 deletions(-) diff --git a/codex-rs/rollout/src/recorder.rs b/codex-rs/rollout/src/recorder.rs index 3bc16c9bbd..08ebd1ea7b 100644 --- a/codex-rs/rollout/src/recorder.rs +++ b/codex-rs/rollout/src/recorder.rs @@ -508,39 +508,6 @@ impl RolloutRecorder { .await } - #[allow(clippy::too_many_arguments)] - pub async fn list_archived_threads_from_state_db( - state_db_ctx: Option, - config: &impl RolloutConfigView, - page_size: usize, - cursor: Option<&Cursor>, - sort_key: ThreadSortKey, - sort_direction: SortDirection, - allowed_sources: &[SessionSource], - model_providers: Option<&[String]>, - cwd_filters: Option<&[PathBuf]>, - default_provider: &str, - search_term: Option<&str>, - ) -> std::io::Result { - Self::list_threads_with_db_fallback( - state_db_ctx, - config, - page_size, - cursor, - sort_key, - sort_direction, - allowed_sources, - model_providers, - cwd_filters, - default_provider, - ThreadListArchiveFilter::Archived, - ThreadListRepairMode::StateDbOnly, - search_term, - /*include_attached_threads*/ false, - ) - .await - } - #[allow(clippy::too_many_arguments)] async fn list_threads_with_db_fallback( state_db_ctx: Option, diff --git a/codex-rs/rollout/src/state_db.rs b/codex-rs/rollout/src/state_db.rs index 4cf78a279b..efb49de592 100644 --- a/codex-rs/rollout/src/state_db.rs +++ b/codex-rs/rollout/src/state_db.rs @@ -291,62 +291,6 @@ pub fn normalize_cwd_for_state_db(cwd: &Path) -> PathBuf { normalize_for_path_comparison(cwd).unwrap_or_else(|_| cwd.to_path_buf()) } -/// List thread ids from SQLite for parity checks without rollout scanning. -#[allow(clippy::too_many_arguments)] -pub async fn list_thread_ids_db( - context: Option<&codex_state::StateRuntime>, - sqlite: &codex_state::SqliteConfig, - page_size: usize, - cursor: Option<&Cursor>, - sort_key: ThreadSortKey, - allowed_sources: &[SessionSource], - model_providers: Option<&[String]>, - archived_only: bool, - stage: &str, -) -> Option> { - let ctx = context?; - if ctx.sqlite() != sqlite { - warn!( - "state db SQLite home mismatch: expected {}, got {}", - sqlite.home().display(), - ctx.sqlite().home().display() - ); - return None; - } - - let anchor = cursor_to_anchor(cursor); - let allowed_sources: Vec = allowed_sources - .iter() - .map(|value| match serde_json::to_value(value) { - Ok(Value::String(s)) => s, - Ok(other) => other.to_string(), - Err(_) => String::new(), - }) - .collect(); - let model_providers = model_providers.map(<[String]>::to_vec); - match ctx - .list_thread_ids( - page_size, - anchor.as_ref(), - match sort_key { - ThreadSortKey::CreatedAt => codex_state::SortKey::CreatedAt, - ThreadSortKey::UpdatedAt => codex_state::SortKey::UpdatedAt, - ThreadSortKey::RecencyAt => codex_state::SortKey::RecencyAt, - }, - allowed_sources.as_slice(), - model_providers.as_deref(), - archived_only, - ) - .await - { - Ok(ids) => Some(ids), - Err(err) => { - warn!("state db list_thread_ids failed during {stage}: {err}"); - None - } - } -} - /// List thread metadata from SQLite without rollout directory traversal. #[allow(clippy::too_many_arguments)] pub async fn list_threads_db(