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
This commit is contained in:
jif
2026-11-24 14:34:38 +00:00
committed by copyberry
parent a2c17b833c
commit 5f2bd3342f
2 changed files with 0 additions and 89 deletions
-33
View File
@@ -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<StateDbHandle>,
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<ThreadsPage> {
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<StateDbHandle>,
-56
View File
@@ -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<Vec<ThreadId>> {
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<String> = 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(