Skip to content

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

Merged
gitar-bot[bot] merged 25 commits into
mainfrom
claude/pr-3587-resolution-tpvyow
Oct 16, 2026
Merged

gitar-bot[bot] merged 25 commits into
mainfrom
claude/pr-3587-resolution-tpvyow

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #3587, which has now merged into main. This PR targets main and contains only one small fix.

  • scripts/install-codex-cloud-command-shims.sh: the two Node version probes ($fallback_node and $node_bin/node) are now quoted, so a supported Node under a directory containing spaces is no longer word-split and rejected before the shims are written.
  • tests/codex-cloud-setup.test.ts: new test that runs the installer with a home directory containing spaces. It fails on the old code and passes now.

Answers one review finding on #3587 that was still open when it merged; the other three were checked and left as they are, with reasons on their threads.

Verification (local, offline)

  • tests/codex-cloud-setup.test.ts + tests/codex-cloud-policy-harness.test.ts: 53 passed
  • prettier clean on the changed test; node scripts/check-codex-cloud-setup.mjs passed earlier on the same code
  • Not run locally: full unit suite and browser journeys (local Node is 22, CI uses 24). Hosted CI is the check for those.

RAG impact: no retrieval behaviour change — setup script and its test only.

🤖 Generated with Claude Code

https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA

BigSimmo and others added 20 commits October 16, 2026 21:20
…v 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>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…GH_TOKEN cleanly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ffline env scrubbing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… codex/cloud-policy-clarity

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d refine GH_TOKEN raw-env warning

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Validate Node version before creating shims
- Allow PATH fallback when nvm has no Node
- Resolve split Node command installations
…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>
… 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
@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 ↗︎.

@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)
✅ Reviewed your PR ff8c5ef Oct 16, 2026 · 16:48 16:51

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 103 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: BigSimmo/PsychSift/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: eb810bea-0410-4ee7-b405-058966417b17
📥 Commits

Reviewing files that changed from the base of the PR and between 7c719b2 and ec906fd.

📒 Files selected for processing: 2
  • scripts/install-codex-cloud-command-shims.sh
  • tests/codex-cloud-setup.test.ts
  • 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

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:49:50.051340Z ff8c5ef PR opened
ℹ️ 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:XS This PR changes 0-9 lines, ignoring generated files label Oct 16, 2026
@codeant-ai

codeant-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: ec906fd3
Scan Time: 2026-10-16 17:37:08 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

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Expect Cloud source in policy-only harness shell profiles

🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Align harness assertions with setup’s creation of three Cloud-sourcing shell profiles.
• Preserve checks that policy-only setup does not probe or install a runtime.
Diagram

graph TD
  Fixture["Isolated harness"] --> Setup["Cloud setup"] --> Profiles["Shell profiles"] --> Assertions["Source assertions"]
  Setup --> Runtime["Runtime untouched"] --> Assertions
Loading
High-Level Assessment

Checking for the Cloud source in each profile matches the intended policy-only setup behavior. Retaining the existing runtime-isolation checks keeps the test focused without changing production code.

Files changed (1) +4 / -1

Tests (1) +4 / -1
codex-cloud-policy-harness.test.tsExpect Cloud source in all three shell profiles +4/-1

Expect Cloud source in all three shell profiles

• Replaces assertions that the shell profiles do not exist with checks that each contains the Cloud profile source. The existing policy and no-runtime-probing assertions remain in place.

tests/codex-cloud-policy-harness.test.ts

@qodo-code-review

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

Copy link
Copy Markdown
Contributor

Code Review by Qodo

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

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. Profile regressions go unnoticed ✗ Dismissed
Description
The policy-only test only checks that a substring of the source line appears somewhere in each
profile, rather than asserting the complete Cloud block is at the top. A future setup change could
append a stale or partial source while this test still passes, so the relocation contract it
exercises would no longer be covered.
Code

tests/codex-cloud-policy-harness.test.ts[R125-126]

+      const contents = readFileSync(path.join(test.home, profile), "utf8");
+      expect(contents).toContain('. "$HOME/.clinical-kb-codex-cloud.sh"');
Relevance

●●● Strong

Recent reviews accept strengthening substring assertions to verify the complete intended contract
and prevent vacuous regression coverage.

PR-#3580
PR-#3535
PR-#2417

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The testing-review skill requires review of modified harness coverage and specifically calls for
identifying fragile assertions. The changed loop uses substring containment only, which leaves the
documented top-of-profile relocation behavior untested.

tests/codex-cloud-policy-harness.test.ts[122-126]
Skill: testing-review

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 policy-only harness accepts any profile containing the substring `. "$HOME/.clinical-kb-codex-cloud.sh"`, so it does not verify that the complete guarded Cloud source block is present at the top of each shell profile.

## Fix Focus Areas
- tests/codex-cloud-policy-harness.test.ts[125-126]

## Recommended Fix
Read each profile and assert its contents begin with the expected Cloud runtime marker and complete guarded source line, while preserving the existing checks that all three profiles are written. Use an exact prefix or equivalent structural assertion so appended, duplicated, or partial profile content cannot satisfy the relocation test.

ⓘ 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
✅ Cross-repo context — repo relationships
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Runtime shim validation and path handling carry meaningful operational risk.

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 ec906fd

Results up to commit ff8c5ef 🚀 Fast


🐞 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. Profile regressions go unnoticed ✗ Dismissed
Description
The policy-only test only checks that a substring of the source line appears somewhere in each
profile, rather than asserting the complete Cloud block is at the top. A future setup change could
append a stale or partial source while this test still passes, so the relocation contract it
exercises would no longer be covered.
Code

tests/codex-cloud-policy-harness.test.ts[R125-126]

+      const contents = readFileSync(path.join(test.home, profile), "utf8");
+      expect(contents).toContain('. "$HOME/.clinical-kb-codex-cloud.sh"');
Relevance

●●● Strong

Recent reviews accept strengthening substring assertions to verify the complete intended contract
and prevent vacuous regression coverage.

PR-#3580
PR-#3535
PR-#2417

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The testing-review skill requires review of modified harness coverage and specifically calls for
identifying fragile assertions. The changed loop uses substring containment only, which leaves the
documented top-of-profile relocation behavior untested.

tests/codex-cloud-policy-harness.test.ts[122-126]
Skill: testing-review

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 policy-only harness accepts any profile containing the substring `. "$HOME/.clinical-kb-codex-cloud.sh"`, so it does not verify that the complete guarded Cloud source block is present at the top of each shell profile.

## Fix Focus Areas
- tests/codex-cloud-policy-harness.test.ts[125-126]

## Recommended Fix
Read each profile and assert its contents begin with the expected Cloud runtime marker and complete guarded source line, while preserving the existing checks that all three profiles are written. Use an exact prefix or equivalent structural assertion so appended, duplicated, or partial profile content cannot satisfy the relocation test.

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


Grey Divider

Qodo Logo

@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[bot]
gitar-bot Bot previously approved these changes Oct 16, 2026

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

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. The profiles start empty, and this only checks that the source appears somewhere. A later early return in .profile or .bash_profile could leave login shells unconfigured while the test still passes.

Possible bug · tests/codex-cloud-policy-harness.test.ts:125-126

@codeant-ai

codeant-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; this narrowly updates the harness assertions for shell profile setup.
  • The test checks that the expected profile block appears at the start of each redirected profile exactly once.

Assessed commit: 9b03ee60fd91

@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: Profile regressions go unnoticed

…pending 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
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NaMorGX7ibPrednN1p5qA
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
@BigSimmo BigSimmo changed the title test(codex-cloud): policy-only harness now expects the Cloud block in shell profiles fix(codex-cloud): quote Node paths in shim installer version probes Oct 16, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 94a24f7

Base automatically changed from codex/cloud-policy-clarity to main October 16, 2026 17:29
@BigSimmo
BigSimmo dismissed gitar-bot[bot]’s stale review October 16, 2026 17:29

The base branch was changed.

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

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Auto-fix isn't included in your plan ↗

Upgrade to Team

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 16, 2026 17:35

@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

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

Copy link
Copy Markdown
Contributor

No code changes since the last review — review skipped

Qodo Logo

@gitar-bot

gitar-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved

🟡 Medium risk · Quoting Node paths changes shim version probing; path-resolution mistakes could reject a supported runtime and leave Codex Cloud shims unavailable.

Quotes Node binary paths in the scripts/install-codex-cloud-command-shims.sh version probes so spaced home directories no longer abort setup, and updates the policy-only harness test to assert the Cloud profile block in .bashrc, .profile, and .bash_profile. No issues found.

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

@gitar-bot
gitar-bot Bot merged commit bb4f151 into main Oct 16, 2026
38 of 39 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/pr-3587-resolution-tpvyow branch October 16, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🕐 Less than 10 minutes 🟠 Medium blast radius size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants