BigPizzaV3/CodexPlusPlus · warning

该主题是旧格式,只支持在线预览或手动下载

Error message

该主题是旧格式,只支持在线预览或手动下载

What it means

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.

Solutions

  1. Pick a newer version of the same theme (if re-published) whose apply_compatible is true.
  2. Use the online preview or manual download flow instead of programmatic install.
  3. Download the package manually and import it via import_theme_package if a newer reader supports it.
  4. Ask the theme author to repackage and republish in the current format.

Example fix

// before
install_community_theme(&state_dir, "legacy-version-id").await?;
// after: check compatibility first
let meta = fetch metadata for version;
if meta.apply_compatible { install_community_theme(&state_dir, id).await?; }
else { open preview page / manual download }
Defensive patterns

Strategy: validation

Validate before calling

let meta: DreamSkinCommunityTheme = fetch_metadata(version_id).await?;
if !meta.apply_compatible {
    // fall back to preview/manual download path instead of install
}

Try / catch

match install_community_theme(&state_dir, version_id).await {
    Err(e) if e.to_string().contains("旧格式") => {
        // open online preview or offer manual download UI
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/b0fa689ecb937bd7. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:160

) -> anyhow::Result<DreamSkinThemeSummary> {
    validate_version_id(version_id)?;
    let client = community_http_client(Duration::from_secs(120))?;
    let metadata_url = format!("{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}");
    let metadata_bytes = download_limited(
        &client,
        &metadata_url,
        METADATA_BYTES_LIMIT,
        "application/json",
    )
    .await?;
    let metadata: DreamSkinCommunityTheme =
        serde_json::from_slice(&metadata_bytes).context("DreamSkin 主题元数据不是有效 JSON")?;
    validate_community_theme(&metadata)?;
    if metadata.id != version_id {
        bail!("DreamSkin 主题版本与请求不一致");
    }
    if !metadata.apply_compatible {
        bail!("该主题是旧格式,只支持在线预览或手动下载");
    }

    let download_url = format!("{COMMUNITY_API_ORIGIN}/v1/themes/{version_id}/download");
    let package = download_limited(
        &client,
        &download_url,
        metadata.package_bytes,
        "application/zip",
    )
    .await?;
    if package.len() != metadata.package_bytes {
        bail!("DreamSkin 主题包实际大小与审核元数据不一致");
    }
    let actual_sha = format!("{:x}", Sha256::digest(&package));
    if !actual_sha.eq_ignore_ascii_case(&metadata.package_sha256) {
        bail!("DreamSkin 主题包 SHA-256 与审核元数据不一致");
    }
    let validated = crate::dream_skin_package::validate_and_read_package(

View on GitHub (pinned to b1ed92e5e4)