mirror of
https://github.com/openai/codex.git
synced 2026-04-27 08:05:51 +00:00
Migrate state DB path helpers to versioned filename (#10623)
Summary - add versioned state sqlite filename helpers and re-export them from the state crate - remove legacy state files when initializing the runtime and update consumers/tests to use the new helpers - tweak logs client description and database resolution to match the new path
This commit is contained in:
@@ -9,7 +9,6 @@ use codex_protocol::protocol::SessionMeta;
|
||||
use codex_protocol::protocol::SessionMetaLine;
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::protocol::UserMessageEvent;
|
||||
use codex_state::STATE_DB_FILENAME;
|
||||
use core_test_support::load_sse_fixture_with_id;
|
||||
use core_test_support::responses;
|
||||
use core_test_support::responses::ev_completed;
|
||||
@@ -39,7 +38,7 @@ async fn new_thread_is_recorded_in_state_db() -> Result<()> {
|
||||
|
||||
let thread_id = test.session_configured.session_id;
|
||||
let rollout_path = test.codex.rollout_path().expect("rollout path");
|
||||
let db_path = test.config.codex_home.join(STATE_DB_FILENAME);
|
||||
let db_path = codex_state::state_db_path(test.config.codex_home.as_path());
|
||||
|
||||
for _ in 0..100 {
|
||||
if tokio::fs::try_exists(&db_path).await.unwrap_or(false) {
|
||||
@@ -149,7 +148,7 @@ async fn backfill_scans_existing_rollouts() -> Result<()> {
|
||||
|
||||
let test = builder.build(&server).await?;
|
||||
|
||||
let db_path = test.config.codex_home.join(STATE_DB_FILENAME);
|
||||
let db_path = codex_state::state_db_path(test.config.codex_home.as_path());
|
||||
let rollout_path = test.config.codex_home.join(&rollout_rel_path);
|
||||
let default_provider = test.config.model_provider_id.clone();
|
||||
|
||||
@@ -205,7 +204,7 @@ async fn user_messages_persist_in_state_db() -> Result<()> {
|
||||
});
|
||||
let test = builder.build(&server).await?;
|
||||
|
||||
let db_path = test.config.codex_home.join(STATE_DB_FILENAME);
|
||||
let db_path = codex_state::state_db_path(test.config.codex_home.as_path());
|
||||
for _ in 0..100 {
|
||||
if tokio::fs::try_exists(&db_path).await.unwrap_or(false) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user