{"record":{"id":"ffc8760c4bf90461","repo":"BigPizzaV3/CodexPlusPlus","slug":"macos-app-did-not-exit-before-debug-relaunch","errorCode":null,"errorMessage":"macOS app did not exit before debug relaunch: {}","messagePattern":"macOS app did not exit before debug relaunch: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/launcher.rs","lineNumber":2747,"sourceCode":"        return Ok(());\n    };\n    let _ = Command::new(executable)\n        .args(&command[1..])\n        .stdout(Stdio::null())\n        .stderr(Stdio::null())\n        .status()\n        .await\n        .with_context(|| format!(\"failed to request macOS app quit for {}\", app_dir.display()))?;\n    Ok(())\n}\n\nasync fn quit_macos_app_and_wait(app_dir: &Path) -> anyhow::Result<()> {\n    run_macos_cleanup_command(app_dir, MacosCleanupPolicy::QuitIfNotPreviouslyRunning).await?;\n    let deadline = tokio::time::Instant::now()\n        + std::time::Duration::from_millis(MACOS_DEBUG_TAKEOVER_WAIT_MS);\n    while is_macos_app_running(app_dir).await {\n        if tokio::time::Instant::now() >= deadline {\n            anyhow::bail!(\n                \"macOS app did not exit before debug relaunch: {}\",\n                app_dir.display()\n            );\n        }\n        tokio::time::sleep(std::time::Duration::from_millis(\n            MACOS_DEBUG_TAKEOVER_INTERVAL_MS,\n        ))\n        .await;\n    }\n    let _ = crate::diagnostic_log::append_diagnostic_log(\n        \"launcher.macos_existing_app_without_cdp_stopped\",\n        serde_json::json!({\n            \"app_dir\": app_dir\n        }),\n    );\n    Ok(())\n}\n","sourceCodeStart":2729,"sourceCodeEnd":2765,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/launcher.rs#L2729-L2765","documentation":"Thrown by quit_macos_app_and_wait when the deadline (MACOS_DEBUG_TAKEOVER_WAIT_MS) expires without the targeted macOS app exiting after a quit request — a precondition for the debug relaunch. The offending input is the app at the given path that failed to terminate in time; the relaunch is aborted rather than risking two instances fighting over the debug port.","triggerScenarios":"Thrown at crates/codex-plus-core/src/launcher.rs:2747 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["手动退出 Codex App 后重试","检查是否有对话框阻塞退出","稍后重试启动接管流程"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}