chore: remove responses-api-proxy from the multitool (#4404)

This removes the `codex responses-api-proxy` subcommand in favor of
running it as a standalone CLI.

As part of this change, we:

- remove the dependency on `tokio`/`async/await` as well as `codex_arg0`
- introduce the use of `pre_main_hardening()` so `CODEX_SECURE_MODE=1`
is not required

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/4404).
* #4406
* __->__ #4404
* #4403
This commit is contained in:
Michael Bolin
2025-09-28 15:22:27 -07:00
committed by GitHub
parent 7407469791
commit 99841332e2
6 changed files with 13 additions and 29 deletions

5
codex-rs/Cargo.lock generated
View File

@@ -695,7 +695,6 @@ dependencies = [
"codex-process-hardening", "codex-process-hardening",
"codex-protocol", "codex-protocol",
"codex-protocol-ts", "codex-protocol-ts",
"codex-responses-api-proxy",
"codex-tui", "codex-tui",
"ctor 0.5.0", "ctor 0.5.0",
"owo-colors", "owo-colors",
@@ -996,13 +995,13 @@ version = "0.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"codex-arg0", "codex-process-hardening",
"ctor 0.5.0",
"libc", "libc",
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"tiny_http", "tiny_http",
"tokio",
"zeroize", "zeroize",
] ]

View File

@@ -53,7 +53,6 @@ codex-ollama = { path = "ollama" }
codex-process-hardening = { path = "process-hardening" } codex-process-hardening = { path = "process-hardening" }
codex-protocol = { path = "protocol" } codex-protocol = { path = "protocol" }
codex-protocol-ts = { path = "protocol-ts" } codex-protocol-ts = { path = "protocol-ts" }
codex-responses-api-proxy = { path = "responses-api-proxy" }
codex-rmcp-client = { path = "rmcp-client" } codex-rmcp-client = { path = "rmcp-client" }
codex-tui = { path = "tui" } codex-tui = { path = "tui" }
codex-utils-readiness = { path = "utils/readiness" } codex-utils-readiness = { path = "utils/readiness" }

View File

@@ -28,7 +28,6 @@ codex-mcp-server = { workspace = true }
codex-process-hardening = { workspace = true } codex-process-hardening = { workspace = true }
codex-protocol = { workspace = true } codex-protocol = { workspace = true }
codex-protocol-ts = { workspace = true } codex-protocol-ts = { workspace = true }
codex-responses-api-proxy = { workspace = true }
codex-tui = { workspace = true } codex-tui = { workspace = true }
ctor = { workspace = true } ctor = { workspace = true }
owo-colors = { workspace = true } owo-colors = { workspace = true }

View File

@@ -1,4 +1,3 @@
use anyhow::Context;
use clap::CommandFactory; use clap::CommandFactory;
use clap::Parser; use clap::Parser;
use clap_complete::Shell; use clap_complete::Shell;
@@ -15,7 +14,6 @@ use codex_cli::login::run_logout;
use codex_cli::proto; use codex_cli::proto;
use codex_common::CliConfigOverrides; use codex_common::CliConfigOverrides;
use codex_exec::Cli as ExecCli; use codex_exec::Cli as ExecCli;
use codex_responses_api_proxy::Args as ResponsesApiProxyArgs;
use codex_tui::AppExitInfo; use codex_tui::AppExitInfo;
use codex_tui::Cli as TuiCli; use codex_tui::Cli as TuiCli;
use owo_colors::OwoColorize; use owo_colors::OwoColorize;
@@ -87,10 +85,6 @@ enum Subcommand {
/// Internal: generate TypeScript protocol bindings. /// Internal: generate TypeScript protocol bindings.
#[clap(hide = true)] #[clap(hide = true)]
GenerateTs(GenerateTsCommand), GenerateTs(GenerateTsCommand),
/// Internal: run the responses API proxy.
#[clap(hide = true)]
ResponsesApiProxy(ResponsesApiProxyArgs),
} }
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
@@ -339,11 +333,6 @@ async fn cli_main(codex_linux_sandbox_exe: Option<PathBuf>) -> anyhow::Result<()
Some(Subcommand::GenerateTs(gen_cli)) => { Some(Subcommand::GenerateTs(gen_cli)) => {
codex_protocol_ts::generate_ts(&gen_cli.out_dir, gen_cli.prettier.as_deref())?; codex_protocol_ts::generate_ts(&gen_cli.out_dir, gen_cli.prettier.as_deref())?;
} }
Some(Subcommand::ResponsesApiProxy(args)) => {
tokio::task::spawn_blocking(move || codex_responses_api_proxy::run_main(args))
.await
.context("responses-api-proxy blocking task panicked")??;
}
} }
Ok(()) Ok(())

View File

@@ -8,7 +8,7 @@ name = "codex_responses_api_proxy"
path = "src/lib.rs" path = "src/lib.rs"
[[bin]] [[bin]]
name = "responses-api-proxy" name = "codex-responses-api-proxy"
path = "src/main.rs" path = "src/main.rs"
[lints] [lints]
@@ -17,11 +17,11 @@ workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] } clap = { workspace = true, features = ["derive"] }
codex-arg0 = { workspace = true } codex-process-hardening = { workspace = true }
ctor = { workspace = true }
libc = { workspace = true } libc = { workspace = true }
reqwest = { workspace = true, features = ["blocking", "json", "rustls-tls"] } reqwest = { workspace = true, features = ["blocking", "json", "rustls-tls"] }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true } serde_json = { workspace = true }
tiny_http = { workspace = true } tiny_http = { workspace = true }
tokio = { workspace = true }
zeroize = { workspace = true } zeroize = { workspace = true }

View File

@@ -1,14 +1,12 @@
use anyhow::Context;
use clap::Parser; use clap::Parser;
use codex_arg0::arg0_dispatch_or_else;
use codex_responses_api_proxy::Args as ResponsesApiProxyArgs; use codex_responses_api_proxy::Args as ResponsesApiProxyArgs;
pub fn main() -> anyhow::Result<()> { #[ctor::ctor]
arg0_dispatch_or_else(|_codex_linux_sandbox_exe| async move { fn pre_main() {
let args = ResponsesApiProxyArgs::parse(); codex_process_hardening::pre_main_hardening();
tokio::task::spawn_blocking(move || codex_responses_api_proxy::run_main(args)) }
.await
.context("responses-api-proxy blocking task panicked")??; pub fn main() -> anyhow::Result<()> {
Ok(()) let args = ResponsesApiProxyArgs::parse();
}) codex_responses_api_proxy::run_main(args)
} }