BigPizzaV3/CodexPlusPlus · error

failed to open DevTools URL

Error message

failed to open DevTools URL: {error}

What it means

open_url wraps codex_plus_core::windows_open_url, the Windows implementation for opening the DevTools URL in the default browser. When that helper returns an error (ShellExecute-style failure), it is remapped into this anyhow error naming the DevTools URL context.

Solutions

  1. Set a default browser in Windows Settings > Default apps
  2. Copy the DevTools URL from launcher output and open it manually
  3. Check windows_open_url's inner error message for the specific shell failure
  4. Verify http/https URL associations are intact (they may be broken after uninstalling a browser)
Defensive patterns

Strategy: fallback

Try / catch

match open_url(devtools_url) {
    Ok(()) => {},
    Err(e) => {
        eprintln!("could not open DevTools URL automatically ({e}); open it manually: {devtools_url}");
        // 回退:把 URL 打印/复制到剪贴板,交给用户手动打开
    }
}

Prevention

When it happens

Trigger: On Windows, codex_plus_core::windows_open_url(url) returned an Err while trying to hand the DevTools URL to the OS shell — e.g. no default browser association, shell API failure, or access issue invoking the opener.

Common situations: Windows machines with no default browser set, restricted/corporate environments blocking ShellExecute on http(s) URLs, or broken browser file associations after uninstalling a browser.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/2842533899776234. Report an issue: GitHub.

Appendix: source

Thrown at apps/codex-plus-launcher/src/main.rs:1086

            let ctx = ctx.clone();
            Box::pin(async move {
                Ok(codex_plus_core::routes::handle_bridge_request(ctx, &path, payload).await)
            })
        }),
        &new_document_scripts,
    )
    .await
}

fn default_codex_db_path() -> PathBuf {
    codex_plus_core::codex_sqlite::codex_session_db_path()
}

fn open_url(url: &str) -> anyhow::Result<()> {
    #[cfg(windows)]
    {
        codex_plus_core::windows_open_url(url)
            .map_err(|error| anyhow::anyhow!("failed to open DevTools URL: {error}"))
    }

    #[cfg(target_os = "macos")]
    {
        std::process::Command::new("open")
            .arg(url)
            .spawn()
            .map(|_| ())
            .map_err(|error| anyhow::anyhow!("failed to open DevTools URL: {error}"))
    }

    #[cfg(all(unix, not(target_os = "macos")))]
    {
        std::process::Command::new("xdg-open")
            .arg(url)
            .spawn()
            .map(|_| ())
            .map_err(|error| anyhow::anyhow!("failed to open DevTools URL: {error}"))

View on GitHub (pinned to b1ed92e5e4)