BigPizzaV3/CodexPlusPlus · error

embedded official remote plugin marketplace is invalid

Error message

embedded official remote plugin marketplace is invalid

What it means

validate_openai_curated_remote_marketplace_root (crates/codex-plus-core/src/plugin_marketplace.rs:484) applies the same manifest contract to the embedded remote marketplace asset: local_openai_curated_remote_marketplace_root_from_root must find .agents/plugins/marketplace.json whose name equals OPENAI_CURATED_REMOTE_MARKETPLACE, a non-empty plugins array, and a plugins/ directory. A None result bails with 'embedded official remote plugin marketplace is invalid'. Because the asset ships inside the binary, this error signals a broken build/embed step or a corrupted extraction — not a network problem.

Source

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

            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");
    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()))?;

View on GitHub (pinned to 1f431ae49b)

Solutions

  1. Regenerate/re-copy the embedded asset and rebuild: ensure the source tree for the remote marketplace contains .agents/plugins/marketplace.json with name == OPENAI_CURATED_REMOTE_MARKETPLACE, non-empty plugins[], and a plugins/ dir
  2. Diff the constant vs the manifest: plugin_marketplace.rs's OPENAI_CURATED_REMOTE_MARKETPLACE must equal the asset's name field exactly after any upstream rename
  3. Run the crate's existing tests around the embedded marketplace (cargo test -p codex-plus-core plugin_marketplace) to catch embed breakage in CI before release
  4. If the runtime-extracted copy is corrupted on disk, clear the extracted cache location so it re-extracts from the binary

Example fix

# before: build embeds the wrong (curated) asset
assets/plugins/marketplace.json  # name: "openai" (curated constant)
# constant expects name: "openai-remote-plugins" -> invalid

# after: embed the remote variant
assets/plugins/marketplace.json  # name matches OPENAI_CURATED_REMOTE_MARKETPLACE
# plus assets/plugins/ with at least one plugin dir
Defensive patterns

Strategy: validation

Validate before calling

// Build-time check: assert the embedded asset passes validation before shipping
#[test]
fn embedded_remote_marketplace_valid() {
    let dir = extract_embedded_remote_marketplace_to_temp();
    assert!(validate_openai_curated_remote_marketplace_root(&dir).is_ok(),
        "embedded asset must ship a valid manifest");
}

Type guard

fn embedded_manifest_matches(value: &serde_json::Value, constant: &str) -> bool {
    value.get("name").and_then(|n| n.as_str()) == Some(constant)
        && value.get("plugins").and_then(|p| p.as_array()).is_some_and(|a| !a.is_empty())
}

Try / catch

if let Err(e) = validate_openai_curated_remote_marketplace_root(&root) {
    if e.to_string().contains("embedded official remote plugin marketplace is invalid") {
        // asset/build problem: fail loudly in CI, degrade at runtime
        tracing::error!("embedded marketplace asset failed validation; rebuild required");
    }
    return Err(e);
}

Prevention

When it happens

Trigger: Building or running with an embedded remote-marketplace asset that fails validation: the include/asset copy step shipped a stale, empty, or wrong-named manifest; the build embedded the curated (non-remote) marketplace by mistake; or runtime extraction of the embedded tree was incomplete.

Common situations: CI builds where the asset-fetch step silently failed and an empty directory got embedded; version skew after the remote marketplace `name` field changed but the constant OPENAI_CURATED_REMOTE_MARKETPLACE was not updated; forks regenerating assets with a different tool that drops the plugins/ dir; tampering with the embedded asset path at rest.

Related errors


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