Skip to content

Share trusted Codex Desktop installation discovery#28253

Open
abhinav-oai wants to merge 3 commits into
mainfrom
codex/desktop-distribution-discovery
Open

Share trusted Codex Desktop installation discovery#28253
abhinav-oai wants to merge 3 commits into
mainfrom
codex/desktop-distribution-discovery

Conversation

@abhinav-oai

@abhinav-oai abhinav-oai commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Why

The CLI and app-bundled features need one answer for where Codex Desktop is installed and whether its resources are trusted. Centralizing that policy avoids separate platform lookup and validation paths drifting apart.

What changed

  • add a shared codex-desktop-installation crate that locates and verifies Codex Desktop installations
  • verify the macOS bundle identity or Windows MSIX package identity before exposing the app root and contained resources
  • move codex app discovery and post-install verification onto the shared implementation

Stack

  1. This PR — trusted Desktop installation discovery and validation
  2. openai/codex#27953 — app-bundled internal hook loading and policy

@abhinav-oai abhinav-oai marked this pull request as ready for review June 15, 2026 04:37

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4633e26cff

ℹ️ 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 thread codex-rs/desktop-installation/src/macos.rs
Comment thread codex-rs/desktop-installation/src/macos.rs
Comment thread codex-rs/cli/src/desktop_app/mac.rs
@abhinav-oai abhinav-oai changed the title Share trusted Codex Desktop distribution discovery Share trusted Codex Desktop installation discovery Jun 15, 2026
const STORE_PUBLISHER_ID: &str = "2p2nqsd0c76g0";

/// Queries the signed stable MSIX identity and uses the package location as the app root.
pub(crate) fn discover() -> Result<Option<VerifiedDesktopInstallation>, DesktopInstallationError> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously Get-StartApps -Name 'Codex' only told us whether a Start-menu app with that name was registered. This now:

  1. queries the OpenAI.Codex MSIX package identity
  2. filters by the OpenAI PublisherId and reads InstallLocation
  3. validates the packaged app/resources path

}
paths
async fn find_existing_codex_app_path() -> anyhow::Result<Option<PathBuf>> {
let installation = tokio::task::spawn_blocking(discover_desktop_installation)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

discover_desktop_installation shells out to platform services, so keep it behind spawn_blocking rather than tying up a Tokio worker while discovery waits.

const TEAM_IDENTIFIER: &str = "2DC432GLL2";

/// Asks LaunchServices for the signed stable Codex app, independent of name or location.
pub(crate) fn discover() -> Result<Option<VerifiedDesktopInstallation>, DesktopInstallationError> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously we accepted /Applications/Codex.app based on its path and name alone. This now:

  1. asks LaunchServices for bundle ID com.openai.codex
  2. verifies the .app shape and Contents/Resources
  3. verifies the code-signing requirement

Sign up for free to 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.

1 participant