Compare commits

...

3 Commits

Author SHA1 Message Date
celia-oai
9fdf129ace changes 2026-02-02 16:33:34 -08:00
celia-oai
d5995076a7 changes 2026-02-02 16:24:21 -08:00
celia-oai
8d4721f46c change 2026-02-02 16:24:21 -08:00
7 changed files with 1101 additions and 1059 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -1254,6 +1254,7 @@ dependencies = [
"clap_complete",
"codex-app-server",
"codex-app-server-protocol",
"codex-app-server-test-client",
"codex-arg0",
"codex-chatgpt",
"codex-cloud-tasks",

View File

@@ -70,6 +70,7 @@ codex-ansi-escape = { path = "ansi-escape" }
codex-api = { path = "codex-api" }
codex-app-server = { path = "app-server" }
codex-app-server-protocol = { path = "app-server-protocol" }
codex-app-server-test-client = { path = "app-server-test-client" }
codex-apply-patch = { path = "apply-patch" }
codex-arg0 = { path = "arg0" }
codex-async-utils = { path = "async-utils" }

View File

@@ -1,6 +1,6 @@
load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "codex-app-server-test-client",
name = "app-server-test-client",
crate_name = "codex_app_server_test_client",
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,7 @@ clap = { workspace = true, features = ["derive"] }
clap_complete = { workspace = true }
codex-app-server = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-app-server-test-client = { workspace = true }
codex-arg0 = { workspace = true }
codex-chatgpt = { workspace = true }
codex-cloud-tasks = { path = "../cloud-tasks" }

View File

@@ -102,9 +102,11 @@ enum Subcommand {
Completion(CompletionCommand),
/// Run commands within a Codex-provided sandbox.
#[clap(visible_alias = "debug")]
Sandbox(SandboxArgs),
/// Debugging tools.
Debug(DebugCommand),
/// Execpolicy tooling.
#[clap(hide = true)]
Execpolicy(ExecpolicyCommand),
@@ -142,6 +144,25 @@ struct CompletionCommand {
shell: Shell,
}
#[derive(Debug, Parser)]
struct DebugCommand {
#[command(subcommand)]
subcommand: DebugSubcommand,
}
#[derive(Debug, clap::Subcommand)]
enum DebugSubcommand {
/// Tooling: helps debug the app server.
AppServer(DebugAppServerCommand),
}
#[derive(Debug, Parser)]
struct DebugAppServerCommand {
/// Message to send through codex-app-server-test-client send-message-v2.
#[arg(value_name = "USER_MESSAGE", required = true, num_args = 1.., trailing_var_arg = true)]
user_message_parts: Vec<String>,
}
#[derive(Debug, Parser)]
struct ResumeCommand {
/// Conversation/session id (UUID) or thread name. UUIDs take precedence if it parses.
@@ -417,6 +438,12 @@ fn run_execpolicycheck(cmd: ExecPolicyCheckCommand) -> anyhow::Result<()> {
cmd.run()
}
fn run_debug_app_server_command(cmd: DebugAppServerCommand) -> anyhow::Result<()> {
let user_message = cmd.user_message_parts.join(" ");
let codex_bin = std::env::current_exe()?;
codex_app_server_test_client::send_message_v2(&codex_bin, &[], user_message, &None)
}
#[derive(Debug, Default, Parser, Clone)]
struct FeatureToggles {
/// Enable a feature (repeatable). Equivalent to `-c features.<name>=true`.
@@ -681,6 +708,11 @@ async fn cli_main(codex_linux_sandbox_exe: Option<PathBuf>) -> anyhow::Result<()
.await?;
}
},
Some(Subcommand::Debug(DebugCommand { subcommand })) => match subcommand {
DebugSubcommand::AppServer(cmd) => {
run_debug_app_server_command(cmd)?;
}
},
Some(Subcommand::Execpolicy(ExecpolicyCommand { sub })) => match sub {
ExecpolicySubcommand::Check(cmd) => run_execpolicycheck(cmd)?,
},