Skip to content

docs(codex-cloud): formalize shell sanitation and guarded GitHub fallback - #1581

Merged
BigSimmo merged 29 commits into
mainfrom
codex/cloud-profile-shims-and-github-pat
Aug 2, 2026
Merged

docs(codex-cloud): formalize shell sanitation and guarded GitHub fallback#1581
BigSimmo merged 29 commits into
mainfrom
codex/cloud-profile-shims-and-github-pat

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • track the profile-loading node/npm/npx shim installer used by both Cloud lifecycle commands
  • document direct fresh-task acceptance and the remaining launcher-level raw-parent boundary
  • add a connected-only, user-authorised, guarded PAT helper for exact stale-branch deletion
  • extend the Cloud contract and focused tests to keep the new safeguards enforced

Safety

  • offline and ordinary connected profiles still scrub all provider variables, including the optional PAT name
  • no provider credentials or agent internet access were enabled
  • the PAT helper requires the connected profile, an explicit non-protected branch, a credential-free origin, and a temporary askpass program

Open in Devin Review

Summary by CodeRabbit

  • New Features

    • Added Codex Cloud command shims for consistent node, npm, and npx usage.
    • Added a guarded emergency workflow for deleting eligible GitHub branches with temporary credentials.
  • Documentation

    • Expanded setup, validation, credential-handling, GitHub access, and offline-operation guidance.
    • Clarified runtime checks, security restrictions, command-shim behavior, and setup lifecycle commands.
  • Bug Fixes

    • Improved setup verification and credential-exposure detection.
    • Autofix workflows now continue when patch application fails.
  • Tests

    • Expanded coverage for credential detection, command shims, and safeguarded branch deletion.

@supabase

supabaseBot commented Aug 2, 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

coderabbitaiBot commented Aug 2, 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:1 minute

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: 209d8613-33a0-4ca3-8581-5b9f58fc4367

📥 Commits

Reviewing files that changed from the base of the PR and between 9b39f7c and f3116b4.

📒 Files selected for processing (1)
  • .github/workflows/autofix.yml
📝 Walkthrough

Walkthrough

Codex Cloud setup now installs profile-loading Node command shims. GitHub branch deletion gains a restricted PAT helper. Credential cleanup, setup validation, runtime checks, documentation, and tests cover the new controls.

Changes

Codex Cloud controls

Layer / File(s)Summary
Install profile-loading command shims
scripts/install-codex-cloud-command-shims.sh, scripts/setup-codex-cloud.sh, docs/codex-cloud.md, README.md, docs/README.md, docs/scripts-index.md, AGENTS.md
Setup and maintenance commands install idempotent node, npm, and npx shims. The shims load the generated profile and resolve Node through nvm.
Constrain PAT-based branch deletion
scripts/delete-codex-cloud-branch-with-pat.sh, docs/codex-cloud.md, AGENTS.md, docs/testing.md, scripts/setup-codex-cloud.sh, tests/codex-cloud-setup.test.ts
The helper validates connected mode, credentials, branch safety, and repository origin. It deletes only the requested branch through temporary GIT_ASKPASS authentication.
Validate setup scripts and runtime checks
scripts/check-codex-cloud-setup.mjs, tests/codex-cloud-setup.test.ts, AGENTS.md, .github/workflows/autofix.yml
Validation covers the new scripts, credential inventory, runtime commands, documentation requirements, repository commands, and browser checks. Tests cover script loading and safety conditions. The autofix workflow continues after patch application errors.

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

Sequence Diagram(s)

sequenceDiagram
participant CloudSetup
participant ShimInstaller
participant RuntimeProfile
participant NodeBinaries
CloudSetup->>ShimInstaller: install command shims
ShimInstaller->>RuntimeProfile: load generated profile
ShimInstaller->>NodeBinaries: resolve node, npm, and npx with nvm
NodeBinaries-->>CloudSetup: executable shims available
Loading
sequenceDiagram
participant Operator
participant BranchDeletionHelper
participant GitHub
Operator->>BranchDeletionHelper: provide branch name and PAT
BranchDeletionHelper->>BranchDeletionHelper: validate mode, branch, origin, and credentials
BranchDeletionHelper->>GitHub: push branch deletion with temporary askpass
GitHub-->>BranchDeletionHelper: deletion result
Loading

Possibly related PRs

Suggested labels:codex

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check nameStatusExplanationResolution
Description check⚠️ WarningThe description includes a useful summary and safety notes but omits the required Verification, Risk and rollout, Clinical Governance Preflight, and Notes sections.Add the required template sections and record verification results, risk and rollback, provider effects, governance checks, or explicit reasons they were not run.
Docstring Coverage⚠️ WarningDocstring 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 (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main changes to shell sanitation and the guarded GitHub fallback.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

@devin-ai-integrationdevin-ai-integrationBot 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.

Devin Review found 4 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment threaddocs/scripts-index.md
Comment threadscripts/install-codex-cloud-command-shims.sh
Comment threadtests/codex-cloud-setup.test.ts Outdated
Comment threadscripts/delete-codex-cloud-branch-with-pat.sh Outdated
Comment threadscripts/install-codex-cloud-command-shims.sh

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:e800a54afd

ℹ️ 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 threadscripts/delete-codex-cloud-branch-with-pat.sh Outdated
Comment threadscripts/install-codex-cloud-command-shims.sh
@github-actions

Copy link
Copy Markdown
Contributor

CI triage

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

  • Static PR checksneeds 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 #7808 (cancelled).

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

@BigSimmo
BigSimmo enabled auto-merge (squash) August 2, 2026 12:17
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent resolve failing CI and merge conflict please

@cursor

cursorBot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Merge conflict with main is resolved and the branch is push-clean again on #1581.

What was wrong

  • Real content conflicts in scripts/check-codex-cloud-setup.mjs and tests/codex-cloud-setup.test.ts (branch shim/PAT checks vs main’s shell-policy setup).
  • That blocked refs/pull/1581/merge, so PR CI could not run — the “failing CI” was the mergeability gate.

What I did

  • Merged origin/main and kept both sides: shell-policy contract checks from main + shim/PAT expectations from this branch; restored main’s temporaryDirectory / temporaryGitRepository helper split.
  • Formatted the resolved files and pushed (c699082a).

Verification

  • merge-tree vs main: clean
  • GitHub: mergeable: MERGEABLE
  • [Codex Cloud Check] PASS: static Cloud contracts match.
  • tests/codex-cloud-setup.test.ts: 17 passed
  • npm run verify:pr-local: passed (475 files / 4973 tests)

Hosted CI is re-running on the new head (Static PR checks in progress).

Open in WebOpen in Cursor

@BigSimmo
BigSimmo disabled auto-merge August 2, 2026 12:19
Keep branch shim/PAT contract checks and main's managed shell-policy
setup contract, and restore the temporaryDirectory /
temporaryGitRepository test helper split from main.
Apply repository Prettier to the conflict-resolved check script and
tests so pre-push and static-pr formatting gates stay green.
@BigSimmo
BigSimmo enabled auto-merge (squash) August 2, 2026 12:22

@coderabbitaicoderabbitaiBot 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

🧹 Nitpick comments (1)
AGENTS.md (1)

869-926: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep AGENTS.md as an orientation entry point.

These lines duplicate lifecycle commands, acceptance procedures, credential rules, and PAT controls from docs/codex-cloud.md. This creates two policy sources that can drift.

Keep a short mandatory pointer to docs/codex-cloud.md here. Keep the detailed Cloud contract in that document.

🤖 Prompt for 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.
In `@AGENTS.md` around lines 869 - 926, Replace the detailed Codex Cloud
lifecycle, validation, credential, provider-access, and GitHub/PAT guidance in
AGENTS.md with a short mandatory pointer directing agents to
docs/codex-cloud.md. Keep AGENTS.md as an orientation entry point and retain the
full operational contract only in the referenced document.

Source: Coding guidelines

🤖 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 `@AGENTS.md`:
- Around line 907-913: Update the GitHub connector guidance near the
authenticated connection description to require repository write access for
ordinary repository, branch, pull-request, review, and Actions work. Remove the
statement that the intended connection has administrator access, and explicitly
reserve administrator access for separately approved operations.
In `@scripts/delete-codex-cloud-branch-with-pat.sh`:
- Line 48: Update the PAT-bearing push command in the branch deletion script to
pass Git’s core.hooksPath configuration as /dev/null, preventing pre-push hooks
from receiving CODEX_CLOUD_GITHUB_PAT. Reflect this hooks-disabled requirement
in the static setup contract and the corresponding assertions in
tests/codex-cloud-setup.test.ts.
---
Nitpick comments:
In `@AGENTS.md`:
- Around line 869-926: Replace the detailed Codex Cloud lifecycle, validation,
credential, provider-access, and GitHub/PAT guidance in AGENTS.md with a short
mandatory pointer directing agents to docs/codex-cloud.md. Keep AGENTS.md as an
orientation entry point and retain the full operational contract only in the
referenced document.
🪄 Autofix (Beta)

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: 3c9257d1-9c52-4e5d-8c35-c12e07cbb57f

📥 Commits

Reviewing files that changed from the base of the PR and between a761bdd and c699082.

📒 Files selected for processing (11)
  • AGENTS.md
  • README.md
  • docs/README.md
  • docs/codex-cloud.md
  • docs/scripts-index.md
  • docs/testing.md
  • scripts/check-codex-cloud-setup.mjs
  • scripts/delete-codex-cloud-branch-with-pat.sh
  • scripts/install-codex-cloud-command-shims.sh
  • scripts/setup-codex-cloud.sh
  • tests/codex-cloud-setup.test.ts

Comment threadAGENTS.md Outdated
Comment threadscripts/delete-codex-cloud-branch-with-pat.sh Outdated
@BigSimmo
BigSimmo disabled auto-merge August 2, 2026 12:26
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@copilot fix failing CI please as well as solve the auto fix failing CI as I thought I deleted the connector

CopilotAI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@copilot fix failing CI please as well as solve the auto fix failing CI as I thought I deleted the connector

Fixed in 9b39f7c. I made the autofix.ci patch step non-blocking (continue-on-error: true) so CI no longer fails when the autofix connector/app auth is unavailable.

@BigSimmo
BigSimmo enabled auto-merge (squash) August 2, 2026 12:48
@BigSimmo
BigSimmo merged commit bf56053 into mainAug 2, 2026
23 checks passed
@BigSimmo
BigSimmo deleted the codex/cloud-profile-shims-and-github-pat branch August 2, 2026 12:53
Sign up for freeto 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.

3 participants

@BigSimmo@cursoragent