Skip to content

Fix Codex Cloud GitHub control plane - #1849

Merged
BigSimmo merged 10 commits into
mainfrom
codex/cloud-github-control-plane
Aug 12, 2026
Merged

Fix Codex Cloud GitHub control plane#1849
BigSimmo merged 10 commits into
mainfrom
codex/cloud-github-control-plane

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep setup-only GitHub credentials out of the Codex Cloud agent credential store; native GitHub connector/task controls remain the supported control plane
  • pin the task merge base and prevent recursive Cloud node/npm command shims
  • retain credential-free origin validation and document the exact Cloud capability boundary

RAG impact: no retrieval behaviour change — Cloud bootstrap, GitHub control-plane policy, and environment documentation only.

Verification

  • npm run check:codex-cloud[Codex Cloud Check] PASS: static Cloud contracts match.
  • npm run docs:check-inventory — current at 226 script files and 236 npm scripts
  • npm run check:branch-review-ledger — passed
  • npm run format — passed immediately before push
  • git diff --check — passed
  • npm run test -- tests/codex-cloud-setup.test.ts — not rerun after the final security repair because the repository run coordinator was at focused-test capacity; the earlier PR head passed 24/24, and CI will exercise the pushed head
  • local lint/typecheck — the pre-push guard reported the repository heavyweight coordinator busy; hosted CI remains authoritative for this pushed head

Risk and rollback

  • Risk: Cloud tasks without native GitHub connector tools may still lack some hosted GitHub operations. This is an explicit platform limitation rather than a reason to persist a setup-only PAT into agent-accessible storage.
  • Rollback: revert the final security repair only if a future platform-owned credential broker exposes narrowly scoped GitHub capabilities without making the underlying credential retrievable by the agent.
  • Provider or production effects: pushed only this non-protected feature branch and updated this PR. No deployment, protected-branch push, PR merge/close, branch deletion, rebase, or force-push.

Review disposition

The prior fix rejected plaintext hosts.yml, but OS-backed storage still allowed the same agent user to run gh auth token or otherwise use the persisted setup credential. Head 6ba68ffed2a3f7b36afa06067f5b2e04800b398e removes that persistence path and adds a static regression guard while retaining the independent base-refresh and command-shim repairs.

Summary by CodeRabbit

  • New Features

    • Codex Cloud setup now automatically refreshes and verifies the checkout’s expected base commit.
    • Runtime setup uses the correct Node installation directly and cleans up inherited command paths.
    • Maintenance workflows now reload the environment before validation.
  • Bug Fixes

    • Improved error handling and validation for unavailable Node versions, invalid commit data, and setup failures.
    • Prevented legacy GitHub authentication provisioning during Cloud lifecycle setup.
  • Documentation

    • Updated script counts and review records.
    • Clarified Codex Cloud setup, acceptance, and remediation procedures.

@supabase

supabase Bot commented Aug 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 58 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 95f56d98-e174-4d76-87a5-6e5ec4530fec

📥 Commits

Reviewing files that changed from the base of the PR and between 9d7f0a7 and 5c52359.

📒 Files selected for processing (3)
  • docs/branch-review-ledger.md
  • scripts/install-codex-cloud-command-shims.sh
  • tests/codex-cloud-setup.test.ts
📝 Walkthrough

Walkthrough

Codex Cloud now refreshes and records the verified origin/main merge base. Runtime setup exports the expected base SHA. Node command shims resolve explicit nvm installation paths and sanitize PATH. Validation, acceptance documentation, and repository records were updated.

Changes

Codex Cloud readiness

Layer / File(s) Summary
Checkout-base lifecycle
scripts/refresh-codex-cloud-base.sh, scripts/setup-codex-cloud.sh, scripts/maintain-codex-cloud.sh, docs/codex-cloud.md, scripts/check-codex-cloud-setup.mjs, tests/codex-cloud-setup.test.ts
Setup and maintenance refresh origin/main, persist the verified merge base, and export CODEX_CLOUD_EXPECTED_BASE_SHA. Acceptance procedures and validation now use this generated SHA.
Node command-shim resolution
scripts/install-codex-cloud-command-shims.sh, scripts/check-codex-cloud-setup.mjs, tests/codex-cloud-setup.test.ts, docs/codex-cloud.md
Command shims resolve Node with nvm version, construct the binary path from NVM_DIR, and remove the local shim directory from PATH. Lifecycle validation rejects legacy GitHub authentication provisioning.

Repository documentation updates

Layer / File(s) Summary
Documentation records
docs/scripts-index.md, docs/branch-review-ledger.md
The scripts index count increased to 226. The review ledger contains reordered current records.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: skip-branch-sync

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change to the Codex Cloud GitHub control plane.
Description check ✅ Passed The description covers the main template sections and explains skipped verification, but it omits the conditional Clinical Governance Preflight section.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cloud-github-control-plane

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7979706395

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/configure-codex-cloud-github-shell.sh Outdated
Comment thread tests/codex-cloud-setup.test.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Unit coverageneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #9872 (success).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/configure-codex-cloud-github-shell.sh`:
- Around line 48-54: Extract the plaintext-credential validation currently at
lines 69-77 into a reusable helper, then invoke it before validate_github_access
in both the existing gh-session path and the PAT authentication path. Ensure any
hosts.yml oauth_token entry causes the script to fail closed, and add a behavior
test covering an existing authenticated session with plaintext hosts.yml
credentials.

In `@scripts/install-codex-cloud-command-shims.sh`:
- Around line 35-40: Update the PATH construction around clean_path in the shim
script so it never emits a trailing separator when clean_path is empty, avoiding
an empty PATH entry that searches the current directory. Preserve node_bin as
the first entry, and retain the existing filtering of the shim directory while
excluding any other empty inherited entries if required by the script’s PATH
policy.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7f861118-9f1b-40ae-b028-db8cbbb6f857

📥 Commits

Reviewing files that changed from the base of the PR and between 34a2f9f and 34e5581.

📒 Files selected for processing (9)
  • docs/codex-cloud.md
  • docs/scripts-index.md
  • scripts/check-codex-cloud-setup.mjs
  • scripts/configure-codex-cloud-github-shell.sh
  • scripts/install-codex-cloud-command-shims.sh
  • scripts/maintain-codex-cloud.sh
  • scripts/refresh-codex-cloud-base.sh
  • scripts/setup-codex-cloud.sh
  • tests/codex-cloud-setup.test.ts

Comment thread scripts/configure-codex-cloud-github-shell.sh Outdated
Comment thread scripts/install-codex-cloud-command-shims.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/branch-review-ledger.md`:
- Line 904: Update the ledger entry for commit
34e5581c4418ef8a08909dff9ecf91d4a8f622de to include the decisive output lines
from check:codex-cloud and docs:check-inventory, rather than only their PASS
status. Also explicitly record whether the focused setup test, local lint, and
local typecheck were run after the final security repair, preserving the
existing verification context.

In `@tests/codex-cloud-setup.test.ts`:
- Around line 633-637: Update the assertions covering setup and maintenance to
verify that bash scripts/refresh-codex-cloud-base.sh appears before the runtime
validation command, rather than only asserting both commands are present.
Preserve the existing command checks while enforcing the required
refresh-before-validation ordering for both lifecycle scripts.
- Around line 627-630: Update the Cloud lifecycle script generation covered by
the setup and maintenance assertions to remove the --configure-gh-helper
invocation and its gh auth setup-git credential bootstrap. Use the native GitHub
connector instead, preserving the existing script behavior while ensuring
neither generated script contains the GitHub CLI authentication or
configure-codex-cloud-github-shell.sh path.
- Around line 638-642: Update the PATH normalization logic exercised by the
command-shim assertions to repeatedly remove adjacent duplicate $HOME/.local/bin
entries until none remain, while preserving first, last, and only-entry
handling. Extend the focused test coverage to assert that consecutive shim
entries are fully removed.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 804ccad6-87ea-4a6c-b590-810675b2bedb

📥 Commits

Reviewing files that changed from the base of the PR and between 34e5581 and 9d7f0a7.

📒 Files selected for processing (8)
  • docs/branch-review-ledger.md
  • docs/codex-cloud.md
  • docs/scripts-index.md
  • scripts/check-codex-cloud-setup.mjs
  • scripts/install-codex-cloud-command-shims.sh
  • scripts/maintain-codex-cloud.sh
  • scripts/setup-codex-cloud.sh
  • tests/codex-cloud-setup.test.ts
💤 Files with no reviewable changes (2)
  • scripts/maintain-codex-cloud.sh
  • scripts/setup-codex-cloud.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • scripts/check-codex-cloud-setup.mjs
  • scripts/install-codex-cloud-command-shims.sh
  • docs/scripts-index.md

Comment thread docs/branch-review-ledger.md
Comment thread tests/codex-cloud-setup.test.ts
Comment thread tests/codex-cloud-setup.test.ts Outdated
Comment thread tests/codex-cloud-setup.test.ts
@BigSimmo
BigSimmo enabled auto-merge August 12, 2026 14:42
@BigSimmo
BigSimmo merged commit 2418a2a into main Aug 12, 2026
24 checks passed
@BigSimmo
BigSimmo deleted the codex/cloud-github-control-plane branch August 12, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant