{"record":{"id":"b0fa689ecb937bd7","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-b0fa68","errorCode":null,"errorMessage":"该主题是旧格式，只支持在线预览或手动下载","messagePattern":"该主题是旧格式，只支持在线预览或手动下载","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/codex-plus-core/src/dream_skin_community.rs","lineNumber":160,"sourceCode":") -> anyhow::Result<DreamSkinThemeSummary> {\n    validate_version_id(version_id)?;\n    let client = community_http_client(Duration::from_secs(120))?;\n    let metadata_url = format!(\"{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}\");\n    let metadata_bytes = download_limited(\n        &client,\n        &metadata_url,\n        METADATA_BYTES_LIMIT,\n        \"application/json\",\n    )\n    .await?;\n    let metadata: DreamSkinCommunityTheme =\n        serde_json::from_slice(&metadata_bytes).context(\"DreamSkin 主题元数据不是有效 JSON\")?;\n    validate_community_theme(&metadata)?;\n    if metadata.id != version_id {\n        bail!(\"DreamSkin 主题版本与请求不一致\");\n    }\n    if !metadata.apply_compatible {\n        bail!(\"该主题是旧格式，只支持在线预览或手动下载\");\n    }\n\n    let download_url = format!(\"{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}/download\");\n    let package = download_limited(\n        &client,\n        &download_url,\n        metadata.package_bytes,\n        \"application/zip\",\n    )\n    .await?;\n    if package.len() != metadata.package_bytes {\n        bail!(\"DreamSkin 主题包实际大小与审核元数据不一致\");\n    }\n    let actual_sha = format!(\"{:x}\", Sha256::digest(&package));\n    if !actual_sha.eq_ignore_ascii_case(&metadata.package_sha256) {\n        bail!(\"DreamSkin 主题包 SHA-256 与审核元数据不一致\");\n    }\n    let validated = crate::dream_skin_package::validate_and_read_package(","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_community.rs#L142-L178","documentation":"install_community_theme only applies themes whose metadata has apply_compatible = true, i.e. packages in the current reviewed format. If the metadata is valid but flags the theme as legacy format, the library refuses to install it programmatically and directs users to preview online or download manually. This is a deliberate capability gate, not a corruption error.","triggerScenarios":"Calling install_community_theme for a version_id whose metadata passes validation but has apply_compatible == false — the theme was uploaded in an old package format that the installer cannot safely unpack/apply.","commonSituations":"Installing a theme published before the current package format was introduced; re-installing an old favorite after a format migration; a catalog entry that still lists legacy themes for browsing/preview.","solutions":["Pick a newer version of the same theme (if re-published) whose apply_compatible is true.","Use the online preview or manual download flow instead of programmatic install.","Download the package manually and import it via import_theme_package if a newer reader supports it.","Ask the theme author to repackage and republish in the current format."],"exampleFix":"// before\ninstall_community_theme(&state_dir, \"legacy-version-id\").await?;\n// after: check compatibility first\nlet meta = fetch metadata for version;\nif meta.apply_compatible { install_community_theme(&state_dir, id).await?; }\nelse { open preview page / manual download }","handlingStrategy":"validation","validationCode":"let meta: DreamSkinCommunityTheme = fetch_metadata(version_id).await?;\nif !meta.apply_compatible {\n    // fall back to preview/manual download path instead of install\n}","typeGuard":null,"tryCatchPattern":"match install_community_theme(&state_dir, version_id).await {\n    Err(e) if e.to_string().contains(\"旧格式\") => {\n        // open online preview or offer manual download UI\n    }\n    other => other?,\n}","preventionTips":["Check apply_compatible in catalog entries before offering an Install button.","Filter or badge legacy themes in the UI so users pick compatible versions.","Prefer the newest version of a theme after format migrations."],"tags":["theme","compatibility","deprecated","rust"],"backgroundTag":"unsupported-operation","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"}