diff --git a/Cargo.lock b/Cargo.lock index 59dda05b..79e4dc49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -928,7 +928,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openresearch-cli" -version = "0.1.49" +version = "0.1.50" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 96e2a5e8..646c1c99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openresearch-cli" -version = "0.1.49" +version = "0.1.50" edition = "2021" description = "OpenResearch CLI (orx) — Rust port" repository = "https://github.com/alphaXiv/openresearch-cli" diff --git a/src/local/harness/codex.rs b/src/local/harness/codex.rs index 91d0f098..7095175f 100644 --- a/src/local/harness/codex.rs +++ b/src/local/harness/codex.rs @@ -325,6 +325,13 @@ async fn run_turn(ctx: &mut TurnCtx) -> Result<()> { }; cmd.arg(prompt); prepare_env(&mut cmd); + // The sandbox blocks the keyring `gh` keeps its token in ("stored token is + // invalid" from inside the workspace), so resolve it out here and pass it + // down; both `gh` and its git credential helper prefer these env vars. + if let Some(token) = crate::local::git::resolve_github_token() { + cmd.env("GH_TOKEN", &token); + cmd.env("GITHUB_TOKEN", token); + } let mut child = cmd .spawn()