Share trusted Codex Desktop installation discovery#28253
Conversation
There was a problem hiding this comment.
💡 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".
| 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> { |
There was a problem hiding this comment.
Previously Get-StartApps -Name 'Codex' only told us whether a Start-menu app with that name was registered. This now:
- queries the
OpenAI.CodexMSIX package identity - filters by the OpenAI
PublisherIdand readsInstallLocation - validates the packaged
app/resourcespath
| } | ||
| paths | ||
| async fn find_existing_codex_app_path() -> anyhow::Result<Option<PathBuf>> { | ||
| let installation = tokio::task::spawn_blocking(discover_desktop_installation) |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Previously we accepted /Applications/Codex.app based on its path and name alone. This now:
- asks LaunchServices for bundle ID
com.openai.codex - verifies the
.appshape andContents/Resources - verifies the code-signing requirement
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
codex-desktop-installationcrate that locates and verifies Codex Desktop installationscodex appdiscovery and post-install verification onto the shared implementationStack