{"record":{"id":"38fba72f52dffd47","repo":"BigPizzaV3/CodexPlusPlus","slug":"openai-plugins-marketplace-download-is-too-large","errorCode":null,"errorMessage":"openai/plugins marketplace download is too large: {} bytes","messagePattern":"openai/plugins marketplace download is too large: (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/plugin_marketplace.rs","lineNumber":316,"sourceCode":"    install_openai_plugins_zip(home, &bytes)\n}\n\nasync fn download_openai_plugins_zip() -> anyhow::Result<Vec<u8>> {\n    let client =\n        crate::http_client::proxied_client(&format!(\"Codex++/{}\", crate::version::VERSION))?;\n    let bytes = client\n        .get(OPENAI_PLUGINS_ZIP_URL)\n        .header(reqwest::header::ACCEPT, \"application/zip\")\n        .send()\n        .await\n        .context(\"failed to download openai/plugins marketplace\")?\n        .error_for_status()\n        .context(\"openai/plugins marketplace download returned an error status\")?\n        .bytes()\n        .await\n        .context(\"failed to read openai/plugins marketplace download body\")?;\n    if bytes.len() > OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES {\n        anyhow::bail!(\n            \"openai/plugins marketplace download is too large: {} bytes\",\n            bytes.len()\n        );\n    }\n    Ok(bytes.to_vec())\n}\n\nfn install_openai_plugins_zip(home: &Path, bytes: &[u8]) -> anyhow::Result<()> {\n    let destination = home.join(\".tmp\").join(\"plugins\");\n    let staging_parent = home.join(\".tmp\");\n    std::fs::create_dir_all(&staging_parent)\n        .with_context(|| format!(\"failed to create {}\", staging_parent.display()))?;\n    let staging = staging_parent.join(format!(\n        \"plugins-download-{}\",\n        std::time::SystemTime::now()\n            .duration_since(std::time::UNIX_EPOCH)\n            .unwrap_or_default()\n            .as_millis()","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/1f431ae49b57b3055e0e6845ba6156c6b4232b4d/crates/codex-plus-core/src/plugin_marketplace.rs#L298-L334","documentation":"download_openai_plugins_zip (crates/codex-plus-core/src/plugin_marketplace.rs:301) fetches OPENAI_PLUGINS_ZIP_URL and enforces a hard ceiling of OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES = 128 MiB (plugin_marketplace.rs:13) on the response body. Exceeding it bails with the byte count. The guard bounds memory and disk exposure when refreshing the bundled openai/plugins marketplace; hitting it means the payload at the URL grew beyond the budget or the URL returned unintended content.","triggerScenarios":"Refreshing the plugin marketplace (the flow that calls download_openai_plugins_zip -> install_openai_plugins_zip) when the served zip exceeds 128 MiB — e.g. upstream dramatically expanded the bundle, the URL now serves an uncompressed or wrong artifact, or a MITM/proxy substitutes content.","commonSituations":"Upstream marketplace bundle growth across versions; corporate proxies serving error pages or repackaged content with huge bodies; a changed OPENAI_PLUGINS_ZIP_URL pointing at a debug/uncompressed artifact; extremely rare in normal operation since the real bundle is far under the cap.","solutions":["Verify what the URL actually returns: curl -sL -o /dev/null -w '%{size_download} %{content_type}' <url> — a size near or above 128 MiB with application/zip means upstream genuinely grew; anything else (HTML, octet-stream junk) means the URL or proxy is wrong","Fix the fetch path: remove intercepting proxies for this host or correct a stale OPENAI_PLUGINS_ZIP_URL constant","If the growth is legitimate, raise OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES in crates/codex-plus-core/src/plugin_marketplace.rs:13 with maintainer sign-off (it is a memory-safety budget) and adjust its tests","Fall back to the embedded marketplace copy for this refresh, then retry later"],"exampleFix":"// before: constant pins the budget\nconst OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES: usize = 128 * 1024 * 1024;\nif bytes.len() > OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES { /* bail */ }\n\n// after (after verifying upstream growth is legitimate)\nconst OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES: usize = 256 * 1024 * 1024;\nif bytes.len() > OPENAI_PLUGINS_DOWNLOAD_LIMIT_BYTES { /* bail */ }","handlingStrategy":"validation","validationCode":"// Pre-flight the artifact size before committing to install\nasync fn artifact_within_budget(url: &str, limit: u64) -> Option<bool> {\n    let resp = reqwest::get(url).await.ok()?;\n    let len = resp.headers().get(reqwest::header::CONTENT_LENGTH)?\n        .to_str().ok()?.parse::<u64>().ok()?;\n    Some(len <= limit)\n}","typeGuard":null,"tryCatchPattern":"match download_openai_plugins_zip().await {\n    Err(e) if e.to_string().contains(\"marketplace download is too large\") => {\n        tracing::warn!(\"marketplace artifact exceeded budget; keeping existing copy\");\n        keep_current_marketplace() // do not wipe installed plugins on oversized download\n    }\n    rest => rest?,\n}","preventionTips":["Keep the installed marketplace when a refresh fails; never delete-then-download","Verify artifact size/content-type with a HEAD or streamed check before buffering","Treat a sudden size explosion as a compromised-artifact signal and verify the source"],"tags":["rust","download","size-limit","plugin-marketplace","http"],"backgroundTag":"download-size-limit-exceeded","analyzedSha":"1f431ae49b57b3055e0e6845ba6156c6b4232b4d","analyzedAt":"2026-08-16T20:54:18.598Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}