mirror of
https://github.com/alphaXiv/OpenResearch.git
synced 2026-11-11 09:59:34 +08:00
Codex harness: inject GitHub token so sandboxed git/gh can authenticate (v0.1.50) (#53)
* Codex harness: inject GitHub token so sandboxed git/gh can authenticate Codex's workspace-write Seatbelt sandbox blocks the macOS keyring, so gh inside the runner reports its stored token invalid and git's credential helper can't authenticate — private-repo fetch/push fail even with the network access granted in #51. Resolve the token in the parent process (GITHUB_TOKEN env, synced env, gh auth token) and pass it to the codex child as GH_TOKEN/GITHUB_TOKEN, which gh and its credential helper prefer over the keyring. * Bump version to 0.1.50
This commit is contained in:
Generated
+1
-1
@@ -928,7 +928,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
||||
|
||||
[[package]]
|
||||
name = "openresearch-cli"
|
||||
version = "0.1.49"
|
||||
version = "0.1.50"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user