Skip to content

fix(pr): bridge split auth in Node CI dispatch - #124674

Merged
steipete merged 1 commit into
mainfrom
fix/pr-gh-wrapper-compat
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/pr-gh-wrapper-compat

Conversation

@steipete

@steipete steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The split-auth repair in #124671 covered the shell helper but missed the Node executor used by scripts/pr ci-dispatch. When only the gh entry on PATH can obtain credentials, the selected plain CLI still receives no token and workflow dispatch fails.

Why This Change Was Made

The credential handoff now lives at the Node plain-CLI execution boundary used by CI dispatch. It asks the authenticated PATH entry for a token only when no token environment already exists, forwards that value only to the selected plain CLI child, and leaves the caller environment unchanged. The shell path uses the same scoped behavior instead of exporting the token into the rest of the shell session. Tokens fetched for a non-public GH_HOST use the CLI's Enterprise token variable in both implementations.

This directly addresses the Node owner-boundary finding recorded on #124671 and the host-variable findings on this PR while retaining the already-landed REST compatibility work unchanged.

This PR is AI-assisted; the implementation and proof were reviewed before publication.

User Impact

Maintainers and automated workers can dispatch exact-head CI when authentication is supplied by a PATH wrapper and writes use a separate full CLI. Existing explicit token environments, Enterprise hosts, and plain CLI configuration continue to work.

Evidence

  • node scripts/run-vitest.mjs test/scripts/plain-gh.test.ts test/scripts/pr-ci-dispatch.test.ts — 16 tests passed, including a full dispatcher route that rejects the write unless credentials are forwarded and process-boundary cases for public and Enterprise hosts.
  • node scripts/check-changed.mjs -- scripts/lib/plain-gh.mjs scripts/lib/plain-gh.sh test/scripts/plain-gh.test.ts test/scripts/pr-ci-dispatch.test.ts — formatting, script/test typechecks, lint, and repository guards passed.
  • Live compatibility probes: both the Node and shell helpers authenticated the separately selected plain CLI with no token pre-exported.
  • Final branch autoreview: clean, no accepted/actionable findings; TruffleHog preflight clean.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 15:51
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 12:23 PM ET / 16:23 UTC.

ClawSweeper review

What this changes

The PR forwards credentials from an authenticated PATH gh wrapper only to the separately selected plain GitHub CLI used by CI-dispatch scripts, including GitHub Enterprise token handling.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a distinct, current-main Node dispatch gap left by the merged shell-side split-auth repair, and the patch cleanly fixes it with no blocking findings.

Priority: P2
Reviewed head: b8c6bafbb1fc4591b396351fa97a01385a64dff1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered owner-boundary repair with no blocking correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal tooling PR is outside the external-contributor proof gate; its exact-head discussion still reports live split-credential probes and focused boundary tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal tooling PR is outside the external-contributor proof gate; its exact-head discussion still reports live split-credential probes and focused boundary tests.
Evidence reviewed 5 items Current-main owner gap: Current main invokes the selected plain CLI with display-normalized environment only, so it cannot receive credentials held solely by the PATH wrapper; the dispatch caller reaches that executor for the workflow write.
Exact-head repair and sibling alignment: The PR creates a child-only authenticated environment, clears the explicit plain-binary override only for wrapper token lookup, maps non-public GH_HOST tokens to the Enterprise variable, and applies equivalent shell scoping.
GitHub CLI contract: The directly inspected GitHub CLI environment help specifies GH_TOKEN for github.com and GH_ENTERPRISE_TOKEN for GitHub Enterprise Server, matching the PR's host-dependent mapping.
Findings None None.
Security None None.

How this fits together

OpenClaw maintainer scripts use the PATH GitHub CLI for cached reads and a selected plain GitHub CLI for writes such as CI dispatch. This change supplies wrapper-held credentials only to that selected child process.

flowchart LR
  A[Maintainer CI command] --> B[PATH GitHub CLI wrapper]
  A --> C[Plain CLI selector]
  B --> D[Scoped token lookup]
  C --> E[Selected plain CLI]
  D --> E
  E --> F[Actions CI dispatch]
  F --> G[Exact-head workflow]
Loading

Before merge

  • Resolve merge risk (P1) - This changes credential selection for every selected plain-CLI call; a mismatch with GitHub CLI host-token semantics could stop Enterprise dispatch, so the verified child-only public and Enterprise cases must remain on the landing head.
  • Complete next step (P2) - No repair lane is needed because the submitted patch addresses the source-proven gap; normal exact-head CI and maintainer landing remain.
Agent review details

Security

None.

PR surface

Tests +63, Other +57. Total +120 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 123 60 +63
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 67 10 +57
Total 4 190 70 +120

Review metrics

Metric Value Why it matters
Production versus test delta production +67/-10 (net +57); tests +123/-60 (net +63) The production growth is the two-language owner-boundary repair; the tests add direct Node/shell and dispatcher behavior coverage.

Merge-risk options

Maintainer options:

  1. Land with scoped auth coverage (recommended)
    Retain the public and Enterprise child-environment regression cases and allow the exact-head checks to complete before landing.

Technical review

Best possible solution:

Keep one canonical child-scoped bridge at the plain-CLI boundary; the positive production delta is warranted because both Node and shell owners must replace the former unscoped or missing handoff without adding configuration.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: a PATH-only authenticated wrapper and separate selected plain CLI reaches the dispatch write without a token on main; the exact-head test makes that write fail until the handoff exists.

Is this the best way to solve the issue?

Yes. The executor is the canonical write boundary, preserving PATH-wrapper reads and keeping credentials out of the caller environment; the shell sibling now follows the same rule.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2b8e94ea4dba.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal tooling PR is outside the external-contributor proof gate; its exact-head discussion still reports live split-credential probes and focused boundary tests.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a bounded internal CI-dispatch authentication failure rather than a user runtime path.
  • merge-risk: 🚨 auth-provider: The patch changes the GitHub CLI token variable selected for public and Enterprise hosts.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal tooling PR is outside the external-contributor proof gate; its exact-head discussion still reports live split-credential probes and focused boundary tests.

Evidence

What I checked:

  • Current-main owner gap: Current main invokes the selected plain CLI with display-normalized environment only, so it cannot receive credentials held solely by the PATH wrapper; the dispatch caller reaches that executor for the workflow write. (scripts/lib/plain-gh.mjs:130, e0e9e272bca0)
  • Exact-head repair and sibling alignment: The PR creates a child-only authenticated environment, clears the explicit plain-binary override only for wrapper token lookup, maps non-public GH_HOST tokens to the Enterprise variable, and applies equivalent shell scoping. (scripts/lib/plain-gh.mjs:55, b8c6bafbb1fc)
  • GitHub CLI contract: The directly inspected GitHub CLI environment help specifies GH_TOKEN for github.com and GH_ENTERPRISE_TOKEN for GitHub Enterprise Server, matching the PR's host-dependent mapping. (scripts/lib/plain-gh.mjs:68, b8c6bafbb1fc)
  • Boundary regression coverage: The tests require the real selected CLI to reject dispatch without the forwarded token, verify the wrapper lookup occurred, and table-drive public and Enterprise token variables across Node and shell paths. (test/scripts/pr-ci-dispatch.test.ts:44, b8c6bafbb1fc)
  • Feature provenance: The merged split-auth repair introduced the current plain-CLI executor behavior and is an ancestor of main; no later main commit changes the four paths in this PR. (scripts/lib/plain-gh.mjs:131, e0e9e272bca0)

Likely related people:

  • steipete: The merged predecessor for this authentication path is attributed to Peter Steinberger, and this follow-up continues that same maintainer-script repair. (role: recent feature owner; confidence: high; commits: e0e9e272bca0; files: scripts/lib/plain-gh.mjs, scripts/lib/plain-gh.sh, scripts/pr-lib/ci-dispatch.mjs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the remaining exact-head checks finish before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-16T15:58:04.536Z sha 602036cce96d84ea989ee851ee5c30188c3ad7f0 :: found issues before merge. :: [P2] Use the Enterprise token variable for GH_HOST | [P2] Mirror Enterprise token selection in the shell helper

steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready at b8c6bafb.

What changed:

  • bridged wrapper-held credentials at the Node plain-CLI write owner used by CI dispatch;
  • scoped shell and Node handoffs to the selected child instead of mutating the caller environment;
  • selected the Enterprise token variable for non-public GH_HOST values in both implementations.

Evidence:

  • node scripts/run-vitest.mjs test/scripts/plain-gh.test.ts test/scripts/pr-ci-dispatch.test.ts — 16 passed, including full-dispatch and public/Enterprise process-boundary cases;
  • node scripts/check-changed.mjs -- scripts/lib/plain-gh.mjs scripts/lib/plain-gh.sh test/scripts/plain-gh.test.ts test/scripts/pr-ci-dispatch.test.ts — formatting, guards, test types, and script lint passed;
  • live public-host Node and shell probes — both authenticated with no token pre-exported;
  • exact-head CI run 31958157097 — green;
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 124674 — hosted exact-head gates accepted at the same SHA;
  • final autoreview — clean, including TruffleHog preflight.

The earlier ClawSweeper Enterprise host-variable findings and rank-up test request are addressed on this head. Its current exact-head comment is still a review-started placeholder; no publisher result is being used as merge evidence. No product-runtime, provider, or channel proof gap applies to this internal maintainer-tooling change.

@steipete
steipete force-pushed the fix/pr-gh-wrapper-compat branch from 602036c to 7711193 Compare August 16, 2026 16:10
@steipete steipete changed the title fix(pr): landing works across authenticated CLI wrappers fix(pr): bridge split auth in Node CI dispatch Aug 16, 2026
@steipete
steipete force-pushed the fix/pr-gh-wrapper-compat branch from 7711193 to b8c6baf Compare August 16, 2026 16:17
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 16, 2026
@steipete
steipete merged commit 9eb68f3 into main Aug 16, 2026
155 of 156 checks passed

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants