{"record":{"id":"07c438f9e4032e7f","repo":"BigPizzaV3/CodexPlusPlus","slug":"embedded-official-remote-plugin-marketplace-root-m","errorCode":null,"errorMessage":"embedded official remote plugin marketplace root mismatch","messagePattern":"embedded official remote plugin marketplace root mismatch","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/plugin_marketplace.rs","lineNumber":518,"sourceCode":"        }\n    }\n    (!relative.as_os_str().is_empty()).then_some(relative)\n}\n\nfn validate_openai_plugins_marketplace_root(root: &Path) -> anyhow::Result<()> {\n    let marketplace = local_openai_curated_marketplace_root_from_root(root)?\n        .ok_or_else(|| anyhow::anyhow!(\"downloaded openai/plugins marketplace is invalid\"))?;\n    if marketplace != root {\n        anyhow::bail!(\"downloaded openai/plugins marketplace root mismatch\");\n    }\n    Ok(())\n}\n\nfn validate_openai_curated_remote_marketplace_root(root: &Path) -> anyhow::Result<()> {\n    let marketplace = local_openai_curated_remote_marketplace_root_from_root(root)?\n        .ok_or_else(|| anyhow::anyhow!(\"embedded official remote plugin marketplace is invalid\"))?;\n    if marketplace != root {\n        anyhow::bail!(\"embedded official remote plugin marketplace root mismatch\");\n    }\n    Ok(())\n}\n\nfn local_openai_curated_marketplace_root_from_root(root: &Path) -> anyhow::Result<Option<PathBuf>> {\n    let marketplace_path = root\n        .join(\".agents\")\n        .join(\"plugins\")\n        .join(\"marketplace.json\");\n    if !marketplace_path.is_file() {\n        return Ok(None);\n    }\n    let text = std::fs::read_to_string(&marketplace_path)\n        .with_context(|| format!(\"failed to read {}\", marketplace_path.display()))?;\n    let marketplace: serde_json::Value = serde_json::from_str(&text)\n        .with_context(|| format!(\"failed to parse {}\", marketplace_path.display()))?;\n    if marketplace.get(\"name\").and_then(serde_json::Value::as_str)\n        != Some(OPENAI_CURATED_MARKETPLACE)","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/plugin_marketplace.rs#L500-L536","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Update the root-detection logic to match the current upstream remote marketplace layout","Regenerate/re-download the embedded marketplace zip from the official source"],"exampleFix":"# before\nembedded.zip → remote-marketplace/.codex-remote/marketplace.json\n# after\nembedded.zip → marketplace.json (at root)","handlingStrategy":"validation","validationCode":"let marker = root.join(\"marketplace.json\");\nif !marker.exists() {\n    return Err(anyhow!(\"remote marketplace marker missing at root\"));\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = validate_openai_curated_remote_marketplace_root(&root) {\n    tracing::error!(\"embedded remote marketplace layout invalid: {e}\");\n    return Err(e);\n}","preventionTips":["Regenerate the embedded zip with a script that guarantees root-level layout","Re-validate the embedded asset in CI on every upstream sync","Document the expected root layout next to the embedding code"],"tags":["zip","marketplace","layout-validation"],"backgroundTag":"unexpected-response-shape","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}