BigPizzaV3/CodexPlusPlus · error

embedded official remote plugin marketplace root mismatch

Error message

embedded official remote plugin marketplace root mismatch

What it means

Thrown by validate_openai_curated_remote_marketplace_root in crates/codex-plus-core/src/plugin_marketplace.rs when validating the layout of the embedded official remote plugin marketplace after extraction. The validator locates the directory containing .agents/plugins/marketplace.json whose name field equals OPENAI_CURATED_REMOTE_MARKETPLACE and whose plugins array is non-empty with a sibling plugins/ directory, then requires that directory to be exactly the expected root. A mismatch means the extracted payload's on-disk layout does not line up with the root the validator was given (e.g. the zip nests content one level deeper, or the marketplace.json landed in a parent/child directory instead of the root).

Source

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

        }
    }
    (!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 1f431ae49b)

Solutions

  1. Delete the extracted marketplace directory and let the tool re-extract the embedded zip from scratch so the layout matches the validator's expectation
  2. Verify the embedded zip actually places .agents/plugins/marketplace.json at the archive root (not nested under an extra folder) and fix the packaging if it does not
  3. Check that marketplace.json has name == the OPENAI_CURATED_REMOTE_MARKETPLACE constant, a non-empty plugins array, and that a plugins/ directory sits next to .agents/
  4. If you pass a custom root, make sure it is the directory that directly contains .agents/, not an ancestor or child of it
Defensive patterns

Strategy: try-catch

Validate before calling

fn marketplace_layout_ok(root: &Path) -> bool {
    let mp = root.join(".agents").join("plugins").join("marketplace.json");
    mp.is_file() && root.join("plugins").is_dir()
}

Try / catch

match install_embedded_remote_marketplace(root) {
    Ok(()) => {}
    Err(e) if e.to_string().contains("marketplace root mismatch") => {
        let _ = std::fs::remove_dir_all(root);
        install_embedded_remote_marketplace(root)?; // clean re-extract
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Bootstrapping or re-extracting the embedded official remote plugin marketplace when the bundled zip's internal layout changed; a build that packaged the marketplace under a subfolder so .agents/plugins/marketplace.json resolves to a different directory than root; calling validate_openai_curated_remote_marketplace_root with a root that is a parent of the actual marketplace directory.

Common situations: Upgrading the crate to a version whose embedded marketplace zip was repackaged with a different directory structure; a corrupted or partially-extracted marketplace cache left over from a previous run; manual edits to ~/.agents/plugins/marketplace.json that renamed or moved the marketplace root.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@1f431ae49b (2026-08-16). Data as JSON: /api/errors/07c438f9e4032e7f. Report an issue: GitHub.