mirror of
https://github.com/openai/codex.git
synced 2026-04-28 00:25:56 +00:00
[codex] Add local thread store listing (#17824)
Builds on top of #17659 Move the filesystem + sqlite thread listing-related operations inside of a local ThreadStore implementation and call ThreadStore from the places that used to perform these filesystem/sqlite operations. This is the first of a series of PRs that will implement the rest of the local ThreadStore. Testing: - added unit tests for the thread store implementation - adjusted some unit tests in the realtime + personality packages whose callsites changed. Specifically I'm trying to hide ThreadMetadata inside of the local implementation and make ThreadMetadata a sqlite implementation detail concern rather than a public interface, preferring the more generate StoredThread interface instead - added a corner case test for the personality migration package that wasn't covered by the existing test suite - adjust the behavior of searched thread listing to run the existing local rollout repair/backfill pass _before_ querying SQLite results, so callers using ThreadStore::list_threads do not miss matches after a partial metadata warm-up
This commit is contained in:
@@ -194,10 +194,16 @@ async fn seed_recent_thread(
|
||||
let db = test.codex.state_db().context("state db enabled")?;
|
||||
let thread_id = ThreadId::new();
|
||||
let updated_at = Utc::now();
|
||||
let rollout_path = test
|
||||
.codex_home_path()
|
||||
.join(format!("rollout-{thread_id}.jsonl"));
|
||||
// This helper seeds SQLite metadata directly. Local listing drops stale metadata rows whose
|
||||
// rollout path no longer exists, so create the placeholder path that the test metadata points
|
||||
// at without exercising rollout writing in this realtime-context test.
|
||||
std::fs::write(&rollout_path, "")?;
|
||||
let mut metadata_builder = codex_state::ThreadMetadataBuilder::new(
|
||||
thread_id,
|
||||
test.codex_home_path()
|
||||
.join(format!("rollout-{thread_id}.jsonl")),
|
||||
rollout_path,
|
||||
updated_at,
|
||||
SessionSource::Cli,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user