{"record":{"id":"8d66e86c399b8ae4","repo":"NousResearch/hermes-agent","slug":"launching-e","errorCode":null,"errorMessage":"launching {}: {e}","messagePattern":"launching (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"apps/bootstrap-installer/src-tauri/src/update.rs","lineNumber":1124,"sourceCode":"#[cfg(not(target_os = \"macos\"))]\nasync fn install_macos_app_update(\n    _app: &AppHandle,\n    _install_root: &Path,\n    target_app: &Path,\n) -> Result<PathBuf> {\n    Ok(target_app.to_path_buf())\n}\n\nasync fn remove_dir_if_exists(path: &Path) {\n    if path.exists() {\n        let _ = tokio::fs::remove_dir_all(path).await;\n    }\n}\n\n#[cfg(target_os = \"macos\")]\nasync fn launch_macos_app_and_exit(app: &AppHandle, target_app: &Path) -> Result<()> {\n    crate::bootstrap::open_macos_app_detached(target_app)\n        .map_err(|e| anyhow!(\"launching {}: {e}\", target_app.display()))?;\n    tokio::time::sleep(std::time::Duration::from_millis(150)).await;\n    app.exit(0);\n    Ok(())\n}\n\n#[cfg(not(target_os = \"macos\"))]\nasync fn launch_macos_app_and_exit(_app: &AppHandle, _target_app: &Path) -> Result<()> {\n    Ok(())\n}\n\n// ---------------------------------------------------------------------------\n// Event helpers — keep emit shape identical to bootstrap.rs so the UI is reused\n// ---------------------------------------------------------------------------\n\nfn stage_info(name: &str, title: &str) -> StageInfo {\n    StageInfo {\n        name: name.to_string(),\n        title: title.to_string(),","sourceCodeStart":1106,"sourceCodeEnd":1142,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/bootstrap-installer/src-tauri/src/update.rs#L1106-L1142","documentation":"macOS-only final step: open_macos_app_detached() failed to relaunch the freshly updated Hermes.app (the error names the bundle path), so the updater cannot hand off to the new version. The update itself already succeeded; only the automatic restart failed. The updater sleeps ~150ms after launching and then exits the Tauri app.","triggerScenarios":"The just-swapped bundle is quarantined or flagged by Gatekeeper so `open`/launch services refuses it; the bundle's executable is missing or not executable; launch services database stale right after the swap; security software blocking the launch.","commonSituations":"xattr -dr com.apple.quarantine (run right after the swap) raced or failed; unsigned/ad-hoc build being relaunched under stricter Gatekeeper; LaunchServices still caching the old bundle identity immediately after the rename-based swap.","solutions":["Simply double-click the updated Hermes.app in Finder — the update is complete; only auto-relaunch failed.","If macOS blocks it: System Settings > Privacy & Security > allow, or `xattr -dr com.apple.quarantine /Applications/Hermes.app`.","Re-sign or properly sign the built app if ad-hoc signing trips Gatekeeper each update.","Retry launching after a few seconds if LaunchServices was momentarily stale."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Verify the swapped bundle is launchable before trying to relaunch.\nfn bundle_launchable(app: &std::path::Path) -> bool {\n    app.join(\"Contents\").join(\"MacOS\").is_dir()\n        && !xattr_quarantined(app)\n}\n\n#[cfg(target_os = \"macos\")]\nfn xattr_quarantined(p: &std::path::Path) -> bool {\n    std::process::Command::new(\"/usr/bin/xattr\").arg(p).output()\n        .map(|o| String::from_utf8_lossy(&o.stdout).contains(\"com.apple.quarantine\"))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"// Update already succeeded — degrade to a manual-restart hint instead of a scary failure.\nmatch crate::bootstrap::open_macos_app_detached(target_app) {\n    Ok(()) => { tokio::time::sleep(Duration::from_millis(150)).await; app.exit(0); }\n    Err(e) => {\n        emit_log(&format!(\"update finished; auto-relaunch failed ({}). Open {} manually.\", e, target_app.display()));\n        app.exit(0); // success exit: the update itself completed\n    }\n}","preventionTips":["If auto-relaunch fails, just open the updated app manually — the update itself is complete.","Properly sign release builds so Gatekeeper doesn't block relaunch after each update.","Run `xattr -dr com.apple.quarantine /Applications/Hermes.app` if macOS blocks the new bundle."],"tags":["macos","launch","gatekeeper","update","bootstrap-installer"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}