openai/codex · error · anyhow::Error
`open -a ` exited with
Error message
`open -a {app_path} {url}` exited with {status} What it means
open_codex_app on macOS: the `open -a` invocation that launches the verified Codex.app bundle with the new-thread URL ran but returned a non-zero exit status. The app exists and passed signature checks; only the launch itself failed.
Solutions
- Run `open -a Codex.app` manually to see crash or launch details
- Update or reinstall the desktop app if it consistently fails to launch
- Check the exit status meaning in the `open` man page
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at codex-rs/cli/src/desktop_app/mac.rs:121 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/92214bec99d67fe1.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/cli/src/desktop_app/mac.rs:121
verify_codex_app_bundle(app_path).await?;
eprintln!(
"Opening workspace {workspace}...",
workspace = workspace.display()
);
let url = codex_new_thread_url(workspace);
let status = Command::new("open")
.arg("-a")
.arg(app_path)
.arg(&url)
.status()
.await
.context("failed to invoke `open`")?;
if status.success() {
return Ok(());
}
anyhow::bail!(
"`open -a {app_path} {url}` exited with {status}",
app_path = app_path.display(),
url = url
);
}
async fn verify_codex_app_bundle(app_path: &Path) -> anyhow::Result<()> {
let requirement = format!(
"identifier \"{CODEX_BUNDLE_IDENTIFIER}\" and anchor apple generic and certificate leaf[subject.OU] = \"{OPENAI_APPLE_TEAM_IDENTIFIER}\""
);
let output = Command::new("/usr/bin/codesign")
.args(["--verify", "--deep", "--strict"])
.arg(format!("-R={requirement}"))
.arg(app_path)
.output()
.await
.context("failed to verify Desktop app signature")?;
View on GitHub (pinned to 339751715c)