BigPizzaV3/CodexPlusPlus · error · anyhow::Error

failed to query CDP targets on loopback addresses: {}

Error message

failed to query CDP targets on loopback addresses: {}

What it means

Raised in list_targets after the CDP /json endpoint failed on both loopback addresses (127.0.0.1 and [::1]) for the debug port; all individual errors are aggregated into the message. Usually means the browser debug port is closed, the browser is not running, or something intercepted the loopback HTTP request.

Source

Thrown at crates/codex-plus-core/src/cdp.rs:139

    let client = reqwest::Client::builder()
        .no_proxy()
        .timeout(CDP_HTTP_TIMEOUT)
        .build()
        .context("failed to build CDP HTTP client")?;

    let urls = [
        format!("http://127.0.0.1:{debug_port}/json"),
        format!("http://[::1]:{debug_port}/json"),
    ];
    let mut errors = Vec::new();
    for url in urls {
        match query_targets_url(&client, &url, debug_port).await {
            Ok(targets) => return Ok(targets),
            Err(error) => errors.push(format!("{url}: {error:#}")),
        }
    }

    bail!(
        "failed to query CDP targets on loopback addresses: {}",
        errors.join("; ")
    )
}

pub async fn browser_identity(debug_port: u16) -> anyhow::Result<CdpBrowserIdentity> {
    let client = reqwest::Client::builder()
        .no_proxy()
        .timeout(CDP_HTTP_TIMEOUT)
        .build()
        .context("failed to build CDP HTTP client")?;
    let urls = [
        format!("http://127.0.0.1:{debug_port}/json/version"),
        format!("http://[::1]:{debug_port}/json/version"),
    ];
    let mut errors = Vec::new();
    for url in urls {
        let result = async {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Confirm the browser runs with --remote-debugging-port=<port>
  2. Check the debug port passed to list_targets
  3. Ensure no proxy intercepts loopback HTTP (client uses no_proxy)
  4. Test `curl http://127.0.0.1:<port>/json` manually
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/codex-plus-core/src/cdp.rs:139 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/480ec31773aefae9. Report an issue: GitHub.