BigPizzaV3/CodexPlusPlus · error · anyhow::Error

embedded official remote plugin marketplace root mismatch

Error message

embedded official remote plugin marketplace root mismatch

What it means

validate_openai_curated_remote_marketplace_root performs the same root check as the local variant but for the embedded official remote plugin marketplace zip: the computed remote marketplace root derived from the extracted tree must equal the extraction root itself. Otherwise the embedded archive's layout doesn't match the expected structure.

Solutions

  1. Inspect the embedded zip's top-level structure and align it with local_openai_curated_remote_marketplace_root_from_root's expectations (flatten extra nesting)
  2. Update the root-detection logic to match the current upstream remote marketplace layout
  3. Regenerate/re-download the embedded marketplace zip from the official source

Example fix

# before
embedded.zip → remote-marketplace/.codex-remote/marketplace.json
# after
embedded.zip → marketplace.json (at root)
Defensive patterns

Strategy: validation

Validate before calling

let marker = root.join("marketplace.json");
if !marker.exists() {
    return Err(anyhow!("remote marketplace marker missing at root"));
}

Try / catch

if let Err(e) = validate_openai_curated_remote_marketplace_root(&root) {
    tracing::error!("embedded remote marketplace layout invalid: {e}");
    return Err(e);
}

Prevention

When it happens

Trigger: install_openai_curated_remote_marketplace_zip extracts the embedded zip and local_openai_curated_remote_marketplace_root_from_root either returns None-converted error ('invalid') or a path different from root because the archive nests content in a subdirectory or lacks the expected remote-marketplace marker files at the top level.

Common situations: The embedded zip was regenerated from an upstream repo whose layout changed; a build step wrapped the archive in an extra directory; the marketplace definition file was renamed or moved in a newer upstream version.

Related errors


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

Appendix: source

Thrown at crates/codex-plus-core/src/plugin_marketplace.rs:518

        }
    }
    (!relative.as_os_str().is_empty()).then_some(relative)
}

fn validate_openai_plugins_marketplace_root(root: &Path) -> anyhow::Result<()> {
    let marketplace = local_openai_curated_marketplace_root_from_root(root)?
        .ok_or_else(|| anyhow::anyhow!("downloaded openai/plugins marketplace is invalid"))?;
    if marketplace != root {
        anyhow::bail!("downloaded openai/plugins marketplace root mismatch");
    }
    Ok(())
}

fn validate_openai_curated_remote_marketplace_root(root: &Path) -> anyhow::Result<()> {
    let marketplace = local_openai_curated_remote_marketplace_root_from_root(root)?
        .ok_or_else(|| anyhow::anyhow!("embedded official remote plugin marketplace is invalid"))?;
    if marketplace != root {
        anyhow::bail!("embedded official remote plugin marketplace root mismatch");
    }
    Ok(())
}

fn local_openai_curated_marketplace_root_from_root(root: &Path) -> anyhow::Result<Option<PathBuf>> {
    let marketplace_path = root
        .join(".agents")
        .join("plugins")
        .join("marketplace.json");
    if !marketplace_path.is_file() {
        return Ok(None);
    }
    let text = std::fs::read_to_string(&marketplace_path)
        .with_context(|| format!("failed to read {}", marketplace_path.display()))?;
    let marketplace: serde_json::Value = serde_json::from_str(&text)
        .with_context(|| format!("failed to parse {}", marketplace_path.display()))?;
    if marketplace.get("name").and_then(serde_json::Value::as_str)
        != Some(OPENAI_CURATED_MARKETPLACE)

View on GitHub (pinned to b1ed92e5e4)