Skip to content

Fall back to HTTP when Apple Git is unavailable - #31496

Merged
fc-oai merged 4 commits into
mainfrom
fc/avoid-macos-git-installer-plugin-sync
Jul 8, 2026
Merged

Fall back to HTTP when Apple Git is unavailable#31496
fc-oai merged 4 commits into
mainfrom
fc/avoid-macos-git-installer-plugin-sync

Conversation

@fc-oai

@fc-oai fc-oai commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • on macOS, resolve the curated plugin sync Git executable without executing it
  • treat Apple’s /usr/bin/git shim as unavailable when xcode-select -p reports that developer tools are absent
  • skip directly to the existing GitHub HTTP fallback in that case
  • preserve the original git command lookup on Windows and Linux, including CCA

Root cause

Curated plugin startup sync invokes git ls-remote before its HTTP fallback. On a clean Mac, git resolves to Apple’s /usr/bin/git shim, and executing the shim opens the Xcode Command Line Tools installer before the process can fail and reach HTTP.

On macOS, this change resolves Git through PATH without executing it. If the selected binary is Apple’s shim and developer tools are unavailable, startup sync marks the Git transport unavailable and enters the existing HTTP fallback immediately.

The new availability detection is macOS-only by construction. Windows and Linux still execute the literal git command as before. If Git is missing on Windows, the existing spawn-error path falls back to HTTP; Linux/CCA receives no new lookup or startup behavior.

Eager Git audit

I also audited production Git process spawns in codex-rs.

  • This curated catalog sync is the only default projectless app-server startup path found.
  • Configured Git marketplace auto-upgrade runs Git at plugin startup, but only after a user has explicitly configured a Git marketplace.
  • Experimental Memories has background Git metadata/baseline paths when the feature is enabled.
  • The separate cloud-tasks UI probes Git during environment autodetection.
  • Normal thread/turn Git metadata is gated by filesystem discovery of an existing .git entry.
  • Marketplace add/install, patch apply, doctor, and TUI /diff paths are explicitly user-invoked.

Validation

  • just fmt
  • just bazel-lock-update — succeeded with no lockfile delta
  • just test -p codex-core-plugins — 313 passed
  • just fix -p codex-core-plugins — completed; emitted one pre-existing unrelated large_enum_variant warning in manifest.rs
  • git diff --check

@fc-oai
fc-oai marked this pull request as ready for review July 7, 2026 23:09
@fc-oai

fc-oai commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: f3f547c701

ℹ️ 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".

@fc-oai
fc-oai enabled auto-merge (squash) July 8, 2026 18:05
@fc-oai
fc-oai merged commit 8d83687 into main Jul 8, 2026
35 checks passed
@fc-oai
fc-oai deleted the fc/avoid-macos-git-installer-plugin-sync branch July 8, 2026 18:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants