BigPizzaV3/CodexPlusPlus · error

无法启动 {}:{error}

Error message

无法启动 {}:{error}

What it means

spawn_companion wraps the std::process::Command::spawn error for the companion binary into this message. It fires when the OS cannot start the companion process at all — typically the binary path does not exist, lacks execute permission, or is blocked — not when the process starts and later exits.

Source

Thrown at crates/codex-plus-core/src/install/mod.rs:292

                let detail = launch_result
                    .map(|status| status.to_string())
                    .unwrap_or_else(|error| error.to_string());
                anyhow::bail!("macOS Launch Services 无法启动 bundle {bundle_id}:{detail}");
            }
        }
    }

    let path = companion_binary_path(binary);
    let mut command = Command::new(&path);
    command.args(&args);
    #[cfg(windows)]
    {
        use std::os::windows::process::CommandExt;
        command.creation_flags(crate::windows_create_no_window());
    }
    command
        .spawn()
        .map_err(|error| anyhow::anyhow!("无法启动 {}:{error}", path.to_string_lossy()))?;
    Ok(path.to_string_lossy().to_string())
}

pub fn macos_companion_bundle_identifier_from_exe(
    exe: &Path,
    binary: &str,
) -> Option<&'static str> {
    let (_, app_name) = macos_applications_dir_and_app_name_from_exe(exe)?;
    let known_bundle =
        app_name == format!("{SILENT_NAME}.app") || app_name == format!("{MANAGER_NAME}.app");
    if !known_bundle {
        return None;
    }
    match binary {
        SILENT_BINARY => Some(SILENT_BUNDLE_ID),
        MANAGER_BINARY => Some(MANAGER_BUNDLE_ID),
        _ => None,
    }

View on GitHub (pinned to f2074595a2)

Solutions

  1. Confirm the companion binary exists and is executable at the resolved path
  2. Check the OS error text in the message for Permission denied vs NotFound
  3. Reinstall the application to restore the bundled companion binary
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/codex-plus-core/src/install/mod.rs:292 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/1c8838a08d72f186. Report an issue: GitHub.