diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock index 82d3988650..101219c32b 100644 --- a/codex-rs/Cargo.lock +++ b/codex-rs/Cargo.lock @@ -495,7 +495,7 @@ dependencies = [ "bytes", "clap", "codex-apply-patch", - "dirs 6.0.0", + "dirs", "env-flags", "eventsource-stream", "fs-err", @@ -589,7 +589,7 @@ dependencies = [ "codex-core", "codex-exec", "codex-repl", - "dirs 5.0.1", + "dirs", "libc", "names", "nanoid", @@ -901,22 +901,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys 0.4.1", -] - [[package]] name = "dirs" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ - "dirs-sys 0.5.0", + "dirs-sys", ] [[package]] @@ -929,18 +920,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.4.6", - "windows-sys 0.48.0", -] - [[package]] name = "dirs-sys" version = "0.5.0" diff --git a/codex-rs/session/Cargo.toml b/codex-rs/session/Cargo.toml index 31b24b99d1..4263376ddb 100644 --- a/codex-rs/session/Cargo.toml +++ b/codex-rs/session/Cargo.toml @@ -28,7 +28,7 @@ uuid = { version = "1", features = ["v4"] } chrono = { version = "0.4", features = ["serde"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1" -dirs = "5" +dirs = "6" sysinfo = "0.29" tabwriter = "1.3" names = { version = "0.14", default-features = false } diff --git a/codex-rs/session/build.rs b/codex-rs/session/build.rs index 16da936201..38e2d62220 100644 --- a/codex-rs/session/build.rs +++ b/codex-rs/session/build.rs @@ -1,8 +1,8 @@ -// build.rs – emit the current git commit so the code can embed it in the +// build.rs -- emit the current git commit so the code can embed it in the // session metadata file. fn main() { - // Try to run `git rev-parse HEAD` – if that fails we fall back to + // Try to run `git rev-parse HEAD` -- if that fails we fall back to // "unknown" so the build does not break when the source is not a git // repository (e.g., during `cargo publish`). let git_sha = std::process::Command::new("git") diff --git a/codex-rs/session/src/build.rs b/codex-rs/session/src/build.rs index edcff408d0..70b1f4db32 100644 --- a/codex-rs/session/src/build.rs +++ b/codex-rs/session/src/build.rs @@ -1,4 +1,4 @@ -//! Build-time information helpers (git commit hash, version, …). +//! Build-time information helpers (git commit hash, version, ...). /// Return the git commit hash that was recorded at compile time via the /// `build.rs` build-script. Falls back to the static string "unknown" when the diff --git a/codex-rs/session/src/meta.rs b/codex-rs/session/src/meta.rs index 4107afc30a..95ae50c823 100644 --- a/codex-rs/session/src/meta.rs +++ b/codex-rs/session/src/meta.rs @@ -32,7 +32,7 @@ pub struct SessionMeta { pub kind: SessionKind, /// Raw command-line arguments that were used to spawn the agent - /// (`codex-exec …` or `codex-repl …`). + /// (`codex-exec ...` or `codex-repl ...`). pub argv: Vec, /// Short preview of the user prompt (if any). diff --git a/codex-rs/session/src/spawn.rs b/codex-rs/session/src/spawn.rs index 73e4275f98..cd61af0bfd 100644 --- a/codex-rs/session/src/spawn.rs +++ b/codex-rs/session/src/spawn.rs @@ -67,7 +67,7 @@ pub fn spawn_exec(paths: &Paths, exec_args: &[String]) -> Result { } let child = cmd.spawn().context("failed to spawn codex-exec")?; - return Ok(child); + Ok(child) } #[cfg(windows)] diff --git a/codex-rs/session/src/store.rs b/codex-rs/session/src/store.rs index b0f0a37329..5425b53b76 100644 --- a/codex-rs/session/src/store.rs +++ b/codex-rs/session/src/store.rs @@ -82,20 +82,16 @@ fn base_dir() -> Result { // in all call-sites. The enum is re-exported so other modules (e.g. the newly // added `meta` module) can still rely on the single source of truth. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default)] #[serde(rename_all = "lowercase")] pub enum SessionKind { /// Non-interactive batch session -- `codex-exec`. + #[default] Exec, /// Line-oriented interactive session -- `codex-repl`. Repl, } -impl Default for SessionKind { - fn default() -> Self { - SessionKind::Exec - } -} /// Create the on-disk directory structure and write metadata + empty log files. /// Create directory & empty log files. Does **not** write metadata; caller should write that