{"record":{"id":"ebb533b962d96cb1","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-app-directory-not-found","errorCode":null,"errorMessage":"Codex App directory not found","messagePattern":"Codex App directory not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/launcher.rs","lineNumber":689,"sourceCode":"    std::env::var(\"CODEX_PLUS_HELPER_BIND\")\n        .ok()\n        .map(|value| value.trim().to_string())\n        .filter(|value| !value.is_empty())\n        .unwrap_or_else(|| \"127.0.0.1\".to_string())\n}\n\n#[async_trait(?Send)]\nimpl LaunchHooks for DefaultLaunchHooks {\n    fn resolve_app_dir(\n        &self,\n        app_dir: Option<&Path>,\n        settings: &BackendSettings,\n    ) -> anyhow::Result<PathBuf> {\n        crate::app_paths::resolve_codex_app_dir_with_saved(\n            app_dir,\n            Some(settings.codex_app_path.as_str()),\n        )\n        .ok_or_else(|| anyhow::anyhow!(\"Codex App directory not found\"))\n    }\n\n    fn select_debug_port(&self, requested: u16) -> u16 {\n        crate::ports::select_packaged_codex_debug_port(requested)\n    }\n\n    fn select_helper_port(&self, requested: u16) -> u16 {\n        crate::ports::select_platform_loopback_port(requested)\n    }\n\n    async fn load_settings(&self) -> anyhow::Result<BackendSettings> {\n        SettingsStore::default().load()\n    }\n\n    fn cleanup_unsupported_config(&self) -> anyhow::Result<()> {\n        let home = crate::relay_config::default_codex_home_dir();\n        crate::relay_config::cleanup_unsupported_approval_policies_in_home(&home)?;\n        Ok(())","sourceCodeStart":671,"sourceCodeEnd":707,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/launcher.rs#L671-L707","documentation":"resolve_app_dir resolves the Codex App directory from the provided path or the saved backend setting; when neither yields a valid directory, it returns this error. It is a precondition failure: the launcher cannot proceed without knowing where the Codex app lives.","triggerScenarios":"Calling launch with app_dir=None and settings.codex_app_path empty or pointing at a non-existent directory, so resolve_codex_app_dir_with_saved returns None.","commonSituations":"Fresh install where the user never picked the Codex app location; user moved/deleted the Codex app; stale saved path after an app update that changed the bundle location.","solutions":["Set the Codex App path in the backend settings to the app bundle/directory (e.g. /Applications/Codex.app)","Reinstall the Codex app if it was removed","Clear the stale saved path so auto-detection can find the app again"],"exampleFix":"// before (settings)\ncodexAppPath: \"\"\n// after\ncodexAppPath: \"/Applications/Codex.app\"","handlingStrategy":"validation","validationCode":"fn app_dir_configured(settings: &BackendSettings) -> bool {\n    !settings.codex_app_path.is_empty()\n        && std::path::Path::new(&settings.codex_app_path).is_dir()\n}","typeGuard":null,"tryCatchPattern":"match resolve_app_dir(&app, None, &settings) {\n    Err(e) if e.to_string() == \"Codex App directory not found\" => {\n        // open settings UI asking the user to locate Codex.app\n    }\n    other => other?,\n}","preventionTips":["Prompt users to set the Codex app path on first run and validate it is a directory","Re-validate the saved path at startup and clear it if the app was moved/uninstalled","Use platform default locations (/Applications, ~/Applications) as fallbacks"],"tags":["configuration","launcher","missing-path"],"backgroundTag":"directory-not-found","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}