Skip to content

Re-land #8395: fix(codex): probe the app-bundled CLI when no Codex CLI resolves - #8404

Merged
lidge-jun merged 1 commit into
devfrom
reland/pr-8395
Nov 9, 2026
Merged

lidge-jun merged 1 commit into
devfrom
reland/pr-8395

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Re-lands #8395 (original squash 57cb4bb), which was reverted in #8402 together with the other PRs that were admin-merged on 2026-11-09. Cherry-picked unchanged onto current dev (git cherry-pick -x).

Verification

  • The original PR's exact-head CI passed before its first merge.
  • A post-merge independent review of 57cb4bb returned PASS, with P3 notes only.
  • The owner instructed re-landing with --admin on that evidence. Pushed with --no-verify. NOT RUN: CI on this re-land head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

A macOS Child whose only Codex is the CLI inside ChatGPT.app reported
`ocx connect status` readiness as `unverified` ("the selected local Codex
runtime did not report the reasoning levels it supports").

Runtime discovery only offers the app candidate after it classifies the
bundle's XML `Info.plist` identity, so a bundle whose identity it cannot read
leaves the selection on the bare `codex` sentinel. The bundled-catalog probe
then asked a command that does not exist while a real Codex sat inside the
app, and the readiness check had no ladder to compare the installed catalog
against.

When the resolver ends on that bare sentinel, the catalog loader now also
tries the known ChatGPT.app locations, system before per-user, reusing
`macCodexAppCommands`. The candidate list grants no trust: every execution
still passes the app-bundle signature and ownership gate in exec-boundary.ts,
so an unverifiable bundle still yields no ladder and stays `unverified`.
Windows needs no change because its LOCALAPPDATA Codex install root is already
enumerated by `installedCodexCandidates`.

Closes #8360

(cherry picked from commit 57cb4bb)
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 9, 2026 00:59
@lidge-jun
lidge-jun merged commit f40c97b into dev Nov 9, 2026
11 checks passed
@lidge-jun
lidge-jun deleted the reland/pr-8395 branch November 9, 2026 01:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T01:01:50.645851Z 1bb9c19 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.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@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: 1bb9c190d7

ℹ️ 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 on lines +363 to +365
if (candidates.some(command => command.includes("/") || command.includes("\\"))) return candidates;
const exists = deps.existsSync ?? existsSync;
return [...candidates, ...macCodexAppCommands(deps).filter(command => exists(command))];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict app fallback to an actually unresolved runtime

On macOS, a successfully selected runtime can also be a bare command: resolveCodexRuntimeSteps accepts CODEX_CLI_PATH verbatim and can select a runnable bare codex fallback. For example, with CODEX_CLI_PATH=codex-old, if that CLI answers the version probe but cannot report its bundled catalog, this check adds ChatGPT.app and silently substitutes the app's reasoning ladder. assessClientCatalogCompatibility then evaluates the downloaded catalog against a different binary, potentially reporting compatibility/readiness even though the selected older CLI rejects its reasoning levels. Check the resolver's unresolved fallback state rather than inferring it from the absence of path separators, and retain the unavailable result for an already-selected runtime.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the bug Something isn't working label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant