From 7dfc3a4dc7b20f046a21441d9bd32c9e88eea201 Mon Sep 17 00:00:00 2001 From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com> Date: Thu, 4 Dec 2025 12:00:18 -0800 Subject: [PATCH] add --branch to codex cloud exec (#7602) Adds `--branch` to `codex cloud exec` to set base branch. --- codex-rs/cloud-tasks/src/cli.rs | 4 ++++ codex-rs/cloud-tasks/src/lib.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/codex-rs/cloud-tasks/src/cli.rs b/codex-rs/cloud-tasks/src/cli.rs index 4122aeff6..9c118038e 100644 --- a/codex-rs/cloud-tasks/src/cli.rs +++ b/codex-rs/cloud-tasks/src/cli.rs @@ -28,6 +28,10 @@ pub struct ExecCommand { #[arg(long = "env", value_name = "ENV_ID")] pub environment: String, + /// Git branch to run in Codex Cloud. + #[arg(long = "branch", value_name = "BRANCH", default_value = "main")] + pub branch: String, + /// Number of assistant attempts (best-of-N). #[arg( long = "attempts", diff --git a/codex-rs/cloud-tasks/src/lib.rs b/codex-rs/cloud-tasks/src/lib.rs index 6fc721404..1a3798f75 100644 --- a/codex-rs/cloud-tasks/src/lib.rs +++ b/codex-rs/cloud-tasks/src/lib.rs @@ -101,6 +101,7 @@ async fn run_exec_command(args: crate::cli::ExecCommand) -> anyhow::Result<()> { let crate::cli::ExecCommand { query, environment, + branch, attempts, } = args; let ctx = init_backend("codex_cloud_tasks_exec").await?; @@ -110,7 +111,7 @@ async fn run_exec_command(args: crate::cli::ExecCommand) -> anyhow::Result<()> { &*ctx.backend, &env_id, &prompt, - "main", + &branch, false, attempts, )