mirror of
https://github.com/openai/codex.git
synced 2026-04-29 08:56:38 +00:00
codex: simplify remote sandbox launch payload
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
use clap::Parser;
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
use codex_arg0::arg0_dispatch_or_else;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct ExecServerArgs {
|
||||
@@ -13,11 +11,11 @@ struct ExecServerArgs {
|
||||
listen: String,
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
arg0_dispatch_or_else(|arg0_paths: Arg0DispatchPaths| async move {
|
||||
let args = ExecServerArgs::parse();
|
||||
codex_exec_server::configure_arg0_paths(arg0_paths);
|
||||
codex_exec_server::run_main_with_listen_url(&args.listen).await?;
|
||||
Ok(())
|
||||
})
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let args = ExecServerArgs::parse();
|
||||
codex_exec_server::run_main_with_listen_url(&args.listen)
|
||||
.await
|
||||
.map_err(|err| anyhow::Error::msg(err.to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ mod remote_process;
|
||||
mod rpc;
|
||||
mod server;
|
||||
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
|
||||
pub use client::ExecServerClient;
|
||||
pub use client::ExecServerError;
|
||||
pub use client_api::ExecServerClientConnectOptions;
|
||||
@@ -67,7 +65,3 @@ pub use server::DEFAULT_LISTEN_URL;
|
||||
pub use server::ExecServerListenUrlParseError;
|
||||
pub use server::run_main;
|
||||
pub use server::run_main_with_listen_url;
|
||||
|
||||
pub fn configure_arg0_paths(arg0_paths: Arg0DispatchPaths) {
|
||||
local_process::configure_codex_linux_sandbox_exe(arg0_paths.codex_linux_sandbox_exe);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ impl ExecBackend for RemoteProcess {
|
||||
let sandbox_type = params
|
||||
.sandbox
|
||||
.as_ref()
|
||||
.map_or(SandboxType::None, |sandbox| sandbox.sandbox_type());
|
||||
.map_or(SandboxType::None, |sandbox| sandbox.sandbox);
|
||||
let session = self.client.register_session(&process_id).await?;
|
||||
match self.client.exec(params).await {
|
||||
Ok(_) => {}
|
||||
|
||||
Reference in New Issue
Block a user