This commit is contained in:
Ryan Ragona
2025-04-26 14:25:35 -07:00
parent 96d8d2a37a
commit 337164738a
11 changed files with 25 additions and 20 deletions
+2 -1
View File
@@ -5,7 +5,8 @@ use clap::ValueEnum;
use crate::protocol::AskForApproval;
use crate::protocol::SandboxPolicy;
use serde::{Deserialize, Serialize};
use serde::Deserialize;
use serde::Serialize;
#[derive(Clone, Debug, ValueEnum, Serialize, Deserialize)]
#[value(rename_all = "kebab-case")]
+2 -1
View File
@@ -1,5 +1,6 @@
use clap::Parser;
use serde::{Deserialize, Serialize};
use serde::Deserialize;
use serde::Serialize;
use std::path::PathBuf;
/// Command-line interface for the non-interactive `codex-exec` agent.
+2 -1
View File
@@ -1,7 +1,8 @@
use clap::Parser;
use codex_core::ApprovalModeCliArg;
use codex_core::SandboxModeCliArg;
use serde::{Deserialize, Serialize};
use serde::Deserialize;
use serde::Serialize;
use std::path::PathBuf;
#[derive(Parser, Debug, Clone, Serialize, Deserialize)]
+2 -1
View File
@@ -2,7 +2,8 @@ use clap::ArgAction;
use clap::Parser;
use codex_core::ApprovalModeCliArg;
use codex_core::SandboxModeCliArg;
use serde::{Deserialize, Serialize};
use serde::Deserialize;
use serde::Serialize;
use std::path::PathBuf;
/// Command‑line arguments.
-1
View File
@@ -16,4 +16,3 @@ fn main() {
println!("cargo:rustc-env=GIT_SHA={git_sha}");
}
-1
View File
@@ -7,4 +7,3 @@
pub fn git_sha() -> &'static str {
env!("GIT_SHA")
}
+6 -5
View File
@@ -8,7 +8,8 @@
//! The `create` command therefore has mutually exclusive sub-commands so the appropriate
//! arguments can be forwarded to the underlying agent binaries.
use crate::meta::{AgentCli, SessionMeta};
use crate::meta::AgentCli;
use crate::meta::SessionMeta;
use crate::spawn;
use crate::store;
use anyhow::Context;
@@ -146,10 +147,10 @@ impl CreateCmd {
// Capture the child PID *and* the full CLI config so we can persist it
// in the metadata file.
let spawn_result: Result<(
u32, // pid
Option<String>, // prompt preview
store::SessionKind, // kind
AgentCli, // full CLI config
u32, // pid
Option<String>, // prompt preview
store::SessionKind, // kind
AgentCli, // full CLI config
)> = (|| match self.agent {
AgentKind::Exec(cmd) => {
let args = build_exec_args(&cmd.exec_cli);
+3 -3
View File
@@ -5,11 +5,11 @@
//! This library is thin: it only re-exports the clap CLI and helpers so
//! the binary can stay small and unit tests can call into pure Rust APIs.
pub mod build;
pub mod cli; // public so main.rs can access it.
mod spawn; // process creation helpers
pub mod store; // on-disk bookkeeping (public for tests)
pub mod meta; // richer on-disk metadata envelope
pub mod build; // build-time information helpers
mod spawn; // process creation helpers
pub mod store; // on-disk bookkeeping (public for tests) // build-time information helpers
pub use cli::Cli;
+4 -3
View File
@@ -6,8 +6,10 @@
//! bits of contextual information (like the git commit of the build) makes
//! debugging and reproducibility significantly easier.
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use chrono::DateTime;
use chrono::Utc;
use serde::Deserialize;
use serde::Serialize;
use crate::store::SessionKind;
@@ -86,4 +88,3 @@ impl SessionMeta {
}
}
}
+2 -1
View File
@@ -10,7 +10,8 @@ use anyhow::Result;
// The rich metadata envelope lives in its own module so other parts of the
// crate can import it without pulling in the whole `store` implementation.
use crate::meta::SessionMeta;
use serde::{Deserialize, Serialize};
use serde::Deserialize;
use serde::Serialize;
use std::path::PathBuf;
#[derive(Clone, Debug)]
+2 -2
View File
@@ -1,7 +1,8 @@
//! Simple round-trip test that serialises a freshly constructed `SessionMeta`
//! and deserialises it back to ensure the schema is self-consistent.
use codex_session::meta::{AgentCli, SessionMeta};
use codex_session::meta::AgentCli;
use codex_session::meta::SessionMeta;
use codex_session::store::SessionKind;
#[test]
@@ -33,4 +34,3 @@ fn meta_round_trip() {
assert_eq!(de.pid, 42);
assert!(matches!(de.cli, AgentCli::Exec(_)));
}