{"record":{"id":"92214bec99d67fe1","repo":"openai/codex","slug":"open-a-app-path-url-exited-with-status","errorCode":null,"errorMessage":"`open -a {app_path} {url}` exited with {status}","messagePattern":"`open -a (.+?) (.+?)` exited with (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/cli/src/desktop_app/mac.rs","lineNumber":121,"sourceCode":"    verify_codex_app_bundle(app_path).await?;\n    eprintln!(\n        \"Opening workspace {workspace}...\",\n        workspace = workspace.display()\n    );\n    let url = codex_new_thread_url(workspace);\n    let status = Command::new(\"open\")\n        .arg(\"-a\")\n        .arg(app_path)\n        .arg(&url)\n        .status()\n        .await\n        .context(\"failed to invoke `open`\")?;\n\n    if status.success() {\n        return Ok(());\n    }\n\n    anyhow::bail!(\n        \"`open -a {app_path} {url}` exited with {status}\",\n        app_path = app_path.display(),\n        url = url\n    );\n}\n\nasync fn verify_codex_app_bundle(app_path: &Path) -> anyhow::Result<()> {\n    let requirement = format!(\n        \"identifier \\\"{CODEX_BUNDLE_IDENTIFIER}\\\" and anchor apple generic and certificate leaf[subject.OU] = \\\"{OPENAI_APPLE_TEAM_IDENTIFIER}\\\"\"\n    );\n    let output = Command::new(\"/usr/bin/codesign\")\n        .args([\"--verify\", \"--deep\", \"--strict\"])\n        .arg(format!(\"-R={requirement}\"))\n        .arg(app_path)\n        .output()\n        .await\n        .context(\"failed to verify Desktop app signature\")?;\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/cli/src/desktop_app/mac.rs#L103-L139","documentation":"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.","triggerScenarios":"Thrown at codex-rs/cli/src/desktop_app/mac.rs:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}