{"record":{"id":"738adb34d68342ba","repo":"BigPizzaV3/CodexPlusPlus","slug":"platform","errorCode":null,"errorMessage":"主题包不支持当前平台：{platform}","messagePattern":"主题包不支持当前平台：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":937,"sourceCode":"    }\n    if compare_semver(&manifest.min_client_version, \"1.5.12\").is_gt() {\n        bail!(\n            \"主题包需要更新版本的 Dream Skin 协议：{}\",\n            manifest.min_client_version\n        );\n    }\n    if manifest.platforms.is_empty()\n        || manifest.platforms.len() > 2\n        || has_duplicates(&manifest.platforms)\n        || manifest\n            .platforms\n            .iter()\n            .any(|item| !matches!(item.as_str(), \"macos\" | \"windows\"))\n    {\n        bail!(\"manifest.platforms 无效\");\n    }\n    if !manifest.platforms.iter().any(|item| item == platform) {\n        bail!(\"主题包不支持当前平台：{platform}\");\n    }\n    if manifest.capabilities.is_empty()\n        || manifest.capabilities.len() > 3\n        || has_duplicates(&manifest.capabilities)\n        || manifest\n            .capabilities\n            .iter()\n            .any(|item| !matches!(item.as_str(), \"background\" | \"tokens\" | \"safe-css\"))\n        || !manifest.capabilities.iter().any(|item| item == \"safe-css\")\n    {\n        bail!(\"manifest.capabilities 无效或缺少 safe-css 能力\");\n    }\n    if !safe_manifest_text(&manifest.publisher.display_name, 1, 80, false)\n        || manifest.publisher.id.is_empty()\n        || manifest.publisher.id.len() > 64\n        || !manifest\n            .publisher\n            .id","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_package.rs#L919-L955","documentation":"validate_manifest rejects the package when the current host platform (the `platform` argument passed in) is not listed in manifest.platforms. Unlike error 203 (malformed platform list), the list itself may be valid — the package simply does not support this machine's OS. The message includes the unsupported platform string.","triggerScenarios":"Calling validate_and_read_package on a machine whose platform string (e.g. \"windows\") is absent from the manifest's platforms array, e.g. a macOS-only theme opened on Windows.","commonSituations":"Sharing themes across OSes; downloading a platform-specific theme from a gallery; switching machines and reusing the same package directory.","solutions":["Choose a theme package whose platforms include your current OS","Ask the author to add your platform to manifest.platforms if the theme is OS-agnostic in practice","Verify the manifest platforms field and your platform detection agree on the exact strings \"macos\"/\"windows\"","Skip validation of this package on unsupported machines rather than treating it as a corrupt package"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let current = if cfg!(target_os = \"macos\") { \"macos\" } else { \"windows\" };\nif manifest.platforms.iter().any(|p| p == current) {\n    validate_and_read_package(&path, current)?;\n}","typeGuard":"fn supports_current_platform(platforms: &[String], platform: &str) -> bool {\n    platforms.iter().any(|p| p == platform)\n}","tryCatchPattern":"match validate_and_read_package(&path, platform) {\n    Err(e) if e.to_string().contains(\"不支持当前平台\") => {\n        eprintln!(\"theme not available for {platform}: {e}\"); // degrade gracefully\n    }\n    other => other?,\n}","preventionTips":["Filter package listings by your platform before download","Detect the platform once and reuse the exact \"macos\"/\"windows\" string","Treat this as an expected outcome for cross-platform galleries, not a bug"],"tags":["manifest","platform","compatibility"],"backgroundTag":"unsupported-platform","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"}