mirror of
https://github.com/openai/codex.git
synced 2026-05-03 04:42:20 +03: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:
@@ -6,14 +6,13 @@ use chrono::DateTime;
|
||||
use clap::Parser;
|
||||
use codex_state::LogQuery;
|
||||
use codex_state::LogRow;
|
||||
use codex_state::STATE_DB_FILENAME;
|
||||
use codex_state::StateRuntime;
|
||||
use dirs::home_dir;
|
||||
use owo_colors::OwoColorize;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(name = "codex-state-logs")]
|
||||
#[command(about = "Tail Codex logs from state.sqlite with simple filters")]
|
||||
#[command(about = "Tail Codex logs from the state SQLite DB with simple filters")]
|
||||
struct Args {
|
||||
/// Path to CODEX_HOME. Defaults to $CODEX_HOME or ~/.codex.
|
||||
#[arg(long, env = "CODEX_HOME")]
|
||||
@@ -104,7 +103,7 @@ fn resolve_db_path(args: &Args) -> anyhow::Result<PathBuf> {
|
||||
}
|
||||
|
||||
let codex_home = args.codex_home.clone().unwrap_or_else(default_codex_home);
|
||||
Ok(codex_home.join(STATE_DB_FILENAME))
|
||||
Ok(codex_state::state_db_path(codex_home.as_path()))
|
||||
}
|
||||
|
||||
fn default_codex_home() -> PathBuf {
|
||||
|
||||
Reference in New Issue
Block a user