This commit is contained in:
Ryan Ragona
2025-04-26 15:57:49 -07:00
parent 8ed2704191
commit 2420a6a898
7 changed files with 11 additions and 36 deletions

27
codex-rs/Cargo.lock generated
View File

@@ -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"

View File

@@ -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 }

View File

@@ -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")

View File

@@ -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

View File

@@ -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<String>,
/// Short preview of the user prompt (if any).

View File

@@ -67,7 +67,7 @@ pub fn spawn_exec(paths: &Paths, exec_args: &[String]) -> Result<Child> {
}
let child = cmd.spawn().context("failed to spawn codex-exec")?;
return Ok(child);
Ok(child)
}
#[cfg(windows)]

View File

@@ -82,20 +82,16 @@ fn base_dir() -> Result<PathBuf> {
// 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