Skip to content

fix(codex-cloud): unbreak CI and close open review findings on #3587 - #3588

Merged
gitar-bot[bot] merged 4 commits into
codex/cloud-policy-clarityfrom
claude/pr-3587-resolution-tpvyow
Oct 16, 2026
Merged

gitar-bot[bot] merged 4 commits into
codex/cloud-policy-clarityfrom
claude/pr-3587-resolution-tpvyow

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Follow-up commit for #3587, stacked on its branch (codex/cloud-policy-clarity). Merge this into that branch to turn #3587's CI green.

  • Root cause of the red CI: the new offline credential scrub blanks HEALTH_DEEP_PROBE_SECRET, but src/lib/env.ts required 16+ characters, so any route importing env threw at load. That failed both unit-coverage partitions (93 test files) and the Playwright Next build. A blank value is now treated as unset (same pattern as PROXY_AUTH); a non-blank value under 16 characters is still rejected, and an unset secret keeps the deep probe closed.
  • Shim installer: requires Node major 24 (22.x/20.x no longer pass the PATH fallback), and every PATH lookup skips $HOME/.local/bin so a shim cannot resolve to itself.
  • Profile relocation: drops the old separator so reruns stop adding blank lines.
  • Stale contracts: check-codex-cloud-setup.mjs and tests/codex-cloud-setup.test.ts still described the older shim/profile text; updated to match.

Verification (local, offline)

  • tests/codex-cloud-setup.test.ts + tests/codex-cloud-diagnose.test.ts: 50 passed
  • tests/env.test.ts (2 new cases), tests/work-sync.test.ts, tests/setup-status-route.test.ts: 39 passed
  • node scripts/check-codex-cloud-setup.mjs: PASS; tsc --noEmit and eslint on changed files: clean
  • generate-repo-awareness.mjs --check: snapshot already in step (the CodeRabbit snapshot comment is stale)
  • Not run locally: full unit suite, Playwright build (local Node is 22, CI uses 24). Hosted CI is the check for those.

RAG impact: no retrieval behaviour change — Cloud environment scripts and an env-schema parse rule only.

🤖 Generated with Claude Code

https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA


Generated by Claude Code


Summary by cubic

Treats a blank HEALTH_DEEP_PROBE_SECRET as unset, preventing offline test runs from failing when routes load the environment schema. Non-blank secrets still require at least 16 characters, and an unset secret keeps the deep probe closed.

  • Restricts the Codex Cloud shim installer to Node 24 and skips $HOME/.local/bin in PATH lookups to prevent shims from resolving to themselves.
  • Fixes the PATH cleanup loop hanging when a home path contains glob characters by comparing entries literally instead of via glob replacement.
  • Keeps shell profile updates idempotent and updates the setup contract checks and tests to match.

Written for commit 14aa2a5. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Fix Codex Cloud setup and blank health-probe secrets

What Changed

  • Blank health-probe secrets are treated as unset, so they no longer prevent the app from loading; short non-blank secrets are still rejected, and the probe stays closed when unset.
  • Codex Cloud command shims now require Node 24.15 or newer within the 24.x series and avoid resolving commands through their own directory.
  • Re-running Codex Cloud setup no longer adds extra blank lines to shell profiles.

Impact

✅ Fewer startup failures with blank probe secrets
✅ Codex Cloud commands avoid shim recursion
✅ Cleaner shell profiles after repeated setup

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

- Treat a blank HEALTH_DEEP_PROBE_SECRET as unset. The offline test wrapper now
  blanks it, and the strict min(16) rule made every route importing env throw,
  which failed the unit-coverage and Playwright build jobs. A non-blank value
  must still be 16+ characters, and an unset secret keeps the deep probe closed.
- Shim installer: require Node major 24 (22.x and 20.x no longer pass the
  fallback check), and skip $HOME/.local/bin in every PATH lookup so a shim can
  never resolve to itself.
- Profile relocation: drop the old separator so reruns do not add blank lines.
- Bring the contract checker and tests in line with the shim and profile
  changes already on this branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA
@supabase

supabase Bot commented Oct 16, 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 Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: BigSimmo/PsychSift/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 7b989840-8a18-437d-92a7-b9a77ae375fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codeant-ai

codeant-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 14aa2a56
Scan Time: 2026-10-16 16:27:41 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

gitar-bot[bot]

This comment was marked as resolved.

@BigSimmo
BigSimmo marked this pull request as ready for review October 16, 2026 16:08

@greptile-apps greptile-apps 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.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
🔄 Reviewing your PR… 1e0449d Oct 16, 2026 · 16:08 —

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:12:35.545943Z 1e0449d Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Oct 16, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Restore Codex Cloud CI and make shim setup safe to rerun

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Treat blank deep-probe secrets as unset without accepting short non-blank secrets.
• Require Node 24, prevent shims from selecting themselves, and keep shell profile setup idempotent.
• Align setup checks and regression tests with the corrected behavior.
Diagram

graph TD
  A["Offline scrub"] --> B["Env schema"] --> C["Deep probe"]
  D["Cloud setup"] --> E["Shell profiles"] --> F["Shim installer"] --> G["Node 24 tools"]
  H["Regression checks"] -.-> B
  H -.-> E
  H -.-> F
Loading
High-Level Assessment

The targeted fixes fit the existing design: reuse the schema’s blank-value coercion and correct shim resolution at installation time. Exempting offline builds from validation or changing the wider toolchain would add complexity without addressing these failures as directly.

Files changed (6) +47 / -13

Bug fix (3) +16 / -10
install-codex-cloud-command-shims.shRestrict shim targets to Node 24 and exclude existing shims +11/-9

Restrict shim targets to Node 24 and exclude existing shims

• Rejects other Node majors and removes $HOME/.local/bin from every fallback PATH lookup, preventing generated shims from resolving to themselves.

scripts/install-codex-cloud-command-shims.sh

setup-codex-cloud.shPrevent blank lines accumulating in shell profiles +2/-0

Prevent blank lines accumulating in shell profiles

• Removes the separator left by a prior runtime block before relocating it, so repeated setup runs do not add blank lines.

scripts/setup-codex-cloud.sh

env.tsAccept blank deep-probe secrets as unset +3/-1

Accept blank deep-probe secrets as unset

• Normalizes blank HEALTH_DEEP_PROBE_SECRET values to unset while retaining the 16-character minimum for non-blank values. This lets offline imports load without enabling an unconfigured deep probe.

src/lib/env.ts

Tests (3) +31 / -3
check-codex-cloud-setup.mjsMatch the shim executor contract +1/-1

Match the shim executor contract

• Checks that generated shims execute the resolved absolute command path, matching the current installer output.

scripts/check-codex-cloud-setup.mjs

codex-cloud-setup.test.tsAlign Cloud setup contracts and shim fixture +9/-2

Align Cloud setup contracts and shim fixture

• Checks the current profile relocation behavior and makes the fake Node executable report its version when queried by the stricter shim installer.

tests/codex-cloud-setup.test.ts

env.test.tsCover blank and short deep-probe secrets +21/-0

Cover blank and short deep-probe secrets

• Verifies that a blank secret permits module import as unset and that a non-blank secret shorter than 16 characters still fails validation.

tests/env.test.ts

@qodo-code-review

qodo-code-review Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

1. Working-directory commands disappear 🟠 Medium 🐞 Bug ≡ Correctness ⭐ New
Description
The generated shim rebuilds clean_path with IFS=: read -r -a, which drops a trailing empty
PATH entry rather than preserving it. When the inherited PATH ends in :, the shim removes the
working directory from command lookup for child processes; the installer’s matching fallback_path
loop also loses it during fallback lookups.
Code

scripts/install-codex-cloud-command-shims.sh[83]

+IFS=: read -r -a path_entries <<< "\$PATH"
Relevance

●●● Strong

Deterministic PATH bug: Bash array splitting drops trailing empty entries, so cleanup must preserve
working-directory lookup.

PR-#3151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new array split and reconstruction omit a trailing empty component. The generated wrapper
exports that reconstructed PATH before executing the target command, while the installer uses its
separately reconstructed PATH for fallback command lookups; setup’s runtime profile prepends
directories but retains any inherited trailing colon.

scripts/install-codex-cloud-command-shims.sh[34-45]
scripts/install-codex-cloud-command-shims.sh[54-71]
scripts/install-codex-cloud-command-shims.sh[80-103]
scripts/setup-codex-cloud.sh[148-155]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new PATH-splitting loops discard a trailing empty entry, changing command lookup semantics for a PATH ending in `:`.

## Fix Focus Areas
- scripts/install-codex-cloud-command-shims.sh[34-45]
- scripts/install-codex-cloud-command-shims.sh[81-92]

## Recommended Fix
Filter the shim directory using a literal comparison while preserving every other PATH component, including trailing empty components. Apply the same approach to the installer and generated wrapper, and test a PATH ending in `:`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

No findings for this group

Grey Divider


Resolved findings

1. Cloud setup hangs for some home paths ✓ Resolved
Description
The fallback_path loop tests for a literal $HOME/.local/bin entry, but its replacement
interprets pattern characters in $HOME, so it can leave the entry unchanged forever. When a home
path contains characters such as [1] and its shim directory is on PATH, installation hangs
before it can select a working Node runtime through nvm.
Code

scripts/install-codex-cloud-command-shims.sh[R35-36]

+while [[ "$fallback_path" == *":$HOME/.local/bin:"* ]]; do
+  fallback_path="${fallback_path//:$HOME\/.local\/bin:/:}"
Relevance

●●● Strong

Accepted precedents favor fixing setup path-selection reliability and cache/PATH-related runtime
failures.

PR-#2280
PR-#2724

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
With HOME=/tmp/user[1] and /tmp/user[1]/.local/bin on PATH, the quoted HOME expansion in the
loop condition matches that literal entry. In the substitution, [1] is a pattern matching 1
rather than the literal brackets; the entry remains, so the loop condition stays true. The PR moved
this loop ahead of nvm detection, extending the hang to installations that have a usable nvm
runtime.

scripts/install-codex-cloud-command-shims.sh[32-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PATH cleanup loop can run forever when `$HOME` contains glob characters: its condition finds the literal shim directory, but its pattern-based replacement does not remove it.
## Fix Focus Areas
- scripts/install-codex-cloud-command-shims.sh[34-39]
## Recommended Fix
Split PATH into entries, discard entries exactly equal to `$HOME/.local/bin`, and rejoin the remainder without interpreting the home path as a pattern. Add a regression test using a home path containing bracket characters.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Skills: 4 invoked
  code-quality-review
  testing-review
  review
  deploy
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Shell installer behavior changes affect runtime setup and PATH resolution.

Grey Divider

Tip of the day
💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 14aa2a5 ⚖️ Balanced

Results up to commit 1e0449d ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. Cloud setup hangs for some home paths ✓ Resolved
Description
The fallback_path loop tests for a literal $HOME/.local/bin entry, but its replacement
interprets pattern characters in $HOME, so it can leave the entry unchanged forever. When a home
path contains characters such as [1] and its shim directory is on PATH, installation hangs
before it can select a working Node runtime through nvm.
Code

scripts/install-codex-cloud-command-shims.sh[R35-36]

+while [[ "$fallback_path" == *":$HOME/.local/bin:"* ]]; do
+  fallback_path="${fallback_path//:$HOME\/.local\/bin:/:}"
Relevance

●●● Strong

Accepted precedents favor fixing setup path-selection reliability and cache/PATH-related runtime
failures.

PR-#2280
PR-#2724

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
With HOME=/tmp/user[1] and /tmp/user[1]/.local/bin on PATH, the quoted HOME expansion in the
loop condition matches that literal entry. In the substitution, [1] is a pattern matching 1
rather than the literal brackets; the entry remains, so the loop condition stays true. The PR moved
this loop ahead of nvm detection, extending the hang to installations that have a usable nvm
runtime.

scripts/install-codex-cloud-command-shims.sh[32-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PATH cleanup loop can run forever when `$HOME` contains glob characters: its condition finds the literal shim directory, but its pattern-based replacement does not remove it.
## Fix Focus Areas
- scripts/install-codex-cloud-command-shims.sh[34-39]
## Recommended Fix
Split PATH into entries, discard entries exactly equal to `$HOME/.local/bin`, and rejoin the remainder without interpreting the home path as a pattern. Add a regression test using a home path containing bracket characters.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 702b5b9 🚀 Fast


No changes from previous review

Grey Divider

Qodo Logo

…lob characters

The loop condition matched "$HOME/.local/bin" literally, but the replacement
treated $HOME as a pattern, so a home like /tmp/user[1] left the entry in place
and the loop never ended. Quote the pattern, and add a regression test that
hangs on the old code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 702b5b9

@gitar-bot
gitar-bot Bot dismissed their stale review October 16, 2026 16:17

Auto-approval revoked — new findings require attention.

@gitar-bot

gitar-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

⚠️ Gitar auto-approved this PR but could not enable auto-merge: an unexpected error occurred.

@gitar-bot gitar-bot 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.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

✅ Committed (1) · ☑ Fixed (1)

Grey Divider

Commits pushed directly to this PR — no separate fix PR opened.

Process — 1 fixed
  • ☑ Fixed: Cloud setup hangs for some home paths

…tup contract check

The shim PATH cleanup now compares each entry literally (no glob replacement), so the
static contract check looks for that form instead of the old replacement text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA
@gitar-bot
gitar-bot Bot merged commit b9d688c into codex/cloud-policy-clarity Oct 16, 2026
13 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/pr-3587-resolution-tpvyow branch October 16, 2026 16:27
@gitar-bot

gitar-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Treating blank HEALTH_DEEP_PROBE_SECRET as unset could leave deep-probe checks unavailable, while shim PATH and Node constraints alter setup behavior.

Fixes the Codex Cloud shim installer and blank health-probe secret handling that were breaking CI, with shim PATH lookups no longer resolving to themselves and shell profile reruns no longer adding blank lines. The generated shims' glob-pattern hang, previously flagged, has been addressed. No open issues found.

✅ 1 closed
✅ Bug: Generated shims keep the same glob-pattern hang the installer fix removed

📄 scripts/install-codex-cloud-command-shims.sh:76-78 📄 scripts/install-codex-cloud-command-shims.sh:36 📄 tests/codex-cloud-setup.test.ts:839-851
This commit quotes the replacement pattern in the installer's PATH cleanup loop (line 36). The heredoc that writes every node/npm/npx shim still emits the old unquoted form, clean_path="${clean_path//:$HOME\/.local\/bin:/:}" (line 77). When HOME contains [, * or ? (for example, a directory name containing [1]), the while test on line 76 matches the path literally, but the replacement treats it as a glob, so nothing is removed. The loop then never ends, and every call to node, npm or npx through the shim hangs. The new test only runs the installer and never runs a generated shim, so it doesn't catch this. Fix: emit the quoted pattern in the heredoc, and extend the test to run $HOME/.local/bin/node with a timeout.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 5 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

clean_path="\${clean_path//:\$HOME\/.local\/bin:/:}"
clean_path=""
path_entry_seen=false
IFS=: read -r -a path_entries <<< "\$PATH"

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.

Remediation recommended

1. Working-directory commands disappear 🐞 Bug ≡ Correctness

The generated shim rebuilds clean_path with IFS=: read -r -a, which drops a trailing empty
PATH entry rather than preserving it. When the inherited PATH ends in :, the shim removes the
working directory from command lookup for child processes; the installer’s matching fallback_path
loop also loses it during fallback lookups.
Agent Prompt
## Issue description
The new PATH-splitting loops discard a trailing empty entry, changing command lookup semantics for a PATH ending in `:`.

## Fix Focus Areas
- scripts/install-codex-cloud-command-shims.sh[34-45]
- scripts/install-codex-cloud-command-shims.sh[81-92]

## Recommended Fix
Filter the shim directory using a literal comparison while preserving every other PATH component, including trailing empty components. Apply the same approach to the installer and generated wrapper, and test a PATH ending in `:`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 14aa2a5

gitar-bot Bot pushed a commit that referenced this pull request Oct 16, 2026
…3589)

* docs(codex-cloud): retire xhigh prompt marker gate and clarify raw-env local policy repair

- Retire the general [xhigh-confirmed] prompt marker and resubmission gate in docs/agents/codex-reasoning-effort.md, AGENTS.md, smart-agent-allocation.md, and retired-rules.json while preserving specialist RAG CLI checks

- Clarify in docs/agents/codex-cloud-environment.md, docs/codex-cloud.md, and scripts/check-codex-cloud-raw-env.sh that failed raw-env checks still block app execution and live providers while permitting explicitly requested local policy/doc repair and scrubbed offline checks

- Document how tracked repo instructions, Cloud environment settings, and active chat/process state update on separate lifecycles

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(ledger): record review for codex/cloud-policy-clarity

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: Clarify Cloud setting refresh behavior

* chore(cloud): remove all remaining xhigh marker references and scrub GH_TOKEN cleanly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(ledger): record review for bdb0cea on codex/cloud-policy-clarity

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(codex-cloud): address review threads on raw-env exit semantics and GH_TOKEN warning

* fix(codex-cloud): harden shell profile sourcing, command shims, and offline env scrubbing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(ledger): record review for ce6c8a8 on codex/cloud-policy-clarity

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(codex-cloud): add JSDoc env type annotations to shouldAutoSourceCloudProfile

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(ledger): record review for 51e6077 on codex/cloud-policy-clarity

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(cloud): remove xhighConfirmed from RAG phase receipt schemas and refine GH_TOKEN raw-env warning

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(ledger): record review for 3e0876f on codex/cloud-policy-clarity

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: Relocate existing Cloud profile blocks

* fix: 3 findings — Validate Node version before creating shims; Allow PAT

- Validate Node version before creating shims
- Allow PATH fallback when nvm has no Node
- Resolve split Node command installations

* fix: Report Cloud profile re-exec failures

* fix(codex-cloud): unbreak CI and close open review findings on #3587 (#3588)

* fix(codex-cloud): unbreak CI and close open review findings on #3587

- Treat a blank HEALTH_DEEP_PROBE_SECRET as unset. The offline test wrapper now
  blanks it, and the strict min(16) rule made every route importing env throw,
  which failed the unit-coverage and Playwright build jobs. A non-blank value
  must still be 16+ characters, and an unset secret keeps the deep probe closed.
- Shim installer: require Node major 24 (22.x and 20.x no longer pass the
  fallback check), and skip $HOME/.local/bin in every PATH lookup so a shim can
  never resolve to itself.
- Profile relocation: drop the old separator so reruns do not add blank lines.
- Bring the contract checker and tests in line with the shim and profile
  changes already on this branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

* fix(codex-cloud): stop shim PATH cleanup hanging on home paths with glob characters

The loop condition matched "$HOME/.local/bin" literally, but the replacement
treated $HOME as a pattern, so a home like /tmp/user[1] left the entry in place
and the loop never ended. Quote the pattern, and add a regression test that
hangs on the old code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

* fix: Remove shim PATH entries using literal comparison

* fix(codex-cloud): match the literal-comparison PATH cleanup in the setup contract check

The shim PATH cleanup now compares each entry literally (no glob replacement), so the
static contract check looks for that form instead of the old replacement text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>

* test(codex-cloud): policy-only harness now expects the Cloud block in shell profiles

#3587 writes the Cloud profile source into .bashrc/.profile/.bash_profile before the
policy-only harness stops, so the relocation can be exercised without a real runtime.
The harness isolation test still asserted those files were never created, which failed
both of its cases in unit coverage partition 2. Assert the block is present instead;
nothing outside the redirected HOME changes and no runtime is probed or installed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

* fix: Assert the complete Cloud profile block at the top

* fix(codex-cloud): align the policy-only harness test with profile prepending and check the npm fallback

The policy-only harness test still asserted that setup leaves .bashrc, .profile and
.bash_profile untouched, but this PR now writes the Cloud profile block to the top of each
before the harness stops (its own setup test depends on that). Assert the new behaviour: the
block is first in every profile, and the runtime-call log still shows no runtime was probed
or installed. This is what failed Unit coverage partition (2).

Also address the open CodeRabbit finding on the shim installer: when the chosen Node install
has no npm or npx and the installer falls back to PATH, require the repository's npm major
(package.json engines.npm) instead of accepting any version. Adds a test for both outcomes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hg9knRJzMaDsgMgtSHmtyh

* fix(codex-cloud): quote Node paths in shim installer version probes

A supported Node under a directory containing spaces was word-split during
the version check, so setup failed before writing the shims. Adds a test with
a spaced home directory (fails on the old code, passes now).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🟠 Medium blast radius size:M This PR changes 30-99 lines, ignoring generated files 🕐 20-40 Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants