BigPizzaV3/CodexPlusPlus · error · anyhow::Error

downloaded openai/plugins marketplace root mismatch

Error message

downloaded openai/plugins marketplace root mismatch

What it means

validate_openai_plugins_marketplace_root checks that the extracted download's root is exactly the expected local openai curated marketplace directory. local_openai_curated_marketplace_root_from_root must return Some(marketplace) equal to the root itself; if it computes a different (or nested) marketplace root, the layout is wrong and this error fires.

Solutions

  1. Unzip the downloaded archive and compare its top-level layout with what local_openai_curated_marketplace_root_from_root expects; flatten a single wrapping directory if present
  2. Check whether the upstream openai/plugins repo restructured and update the root-detection logic accordingly
  3. Re-download the official archive rather than using a mirrored/modified copy

Example fix

# before (nested layout)
extracted/openai-plugins-main/.marketplace
# after (flattened)
extracted/.marketplace
Defensive patterns

Strategy: validation

Validate before calling

let root = extract_dir.join(".marketplace");
if !root.exists() {
    // flatten single wrapper directory before installing
    let entries: Vec<_> = std::fs::read_dir(&extract_dir)?.collect();
    if entries.len() == 1 { /* move child contents up */ }
}

Try / catch

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

Prevention

When it happens

Trigger: install_openai_plugins_zip extracts the downloaded zip and the top-level layout does not match expectations — e.g. the zip wraps everything in an extra folder (repo-name-branch/) so the computed marketplace root is a child of the extraction root rather than the root itself.

Common situations: GitHub changed the repository archive layout (new top-level directory naming); a mirror produces a differently wrapped zip; the code expects marketplace metadata files (e.g. .marketplace or config) at root that are missing, making the root unrecognizable.

Related errors


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

Appendix: source

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

        Component::Normal(_) => {}
        _ => return None,
    }
    let mut relative = PathBuf::new();
    for component in components {
        match component {
            Component::Normal(value) => relative.push(value),
            Component::CurDir => {}
            _ => return None,
        }
    }
    (!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");

View on GitHub (pinned to b1ed92e5e4)