{"record":{"id":"e12276e6deb72822","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-e12276","errorCode":null,"errorMessage":"市场主题 {} 的{}无效","messagePattern":"市场主题 (.+?) 的(.+?)无效","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":214,"sourceCode":"            bail!(\"主题市场清单包含重复 ID：{}\", theme.id);\n        }\n        theme.preview_url = market_asset_url(DEFAULT_MARKET_RAW_BASE_URL, &theme.preview)?;\n    }\n    Ok(())\n}\n\nfn validate_market_theme(theme: &DreamSkinMarketTheme) -> anyhow::Result<()> {\n    if !valid_theme_id(&theme.id) {\n        bail!(\"主题市场包含无效 ID：{}\", theme.id);\n    }\n    for (label, value, limit) in [\n        (\"名称\", theme.name.as_str(), 100usize),\n        (\"版本\", theme.version.as_str(), 40usize),\n        (\"作者\", theme.author.as_str(), 100usize),\n        (\"许可证\", theme.license.as_str(), 100usize),\n    ] {\n        if value.trim().is_empty() || value.len() > limit {\n            bail!(\"市场主题 {} 的{}无效\", theme.id, label);\n        }\n    }\n    if theme.description.len() > 500 || theme.tags.len() > 12 {\n        bail!(\"市场主题 {} 的描述或标签数量超过限制\", theme.id);\n    }\n    if theme\n        .tags\n        .iter()\n        .any(|tag| tag.trim().is_empty() || tag.len() > 32)\n    {\n        bail!(\"市场主题 {} 包含无效标签\", theme.id);\n    }\n    let source = reqwest::Url::parse(&theme.source_url)\n        .with_context(|| format!(\"市场主题 {} 的来源地址无效\", theme.id))?;\n    if !matches!(source.scheme(), \"http\" | \"https\") {\n        bail!(\"市场主题 {} 的来源地址协议无效\", theme.id);\n    }\n    for path in [&theme.theme, &theme.image, &theme.preview] {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_market.rs#L196-L232","documentation":"validate_market_theme checks four textual fields — name (名称), version (版本), author (作者), license (许可证) — for being blank or exceeding their per-field length limits (100/40/100/100 chars). Any violation aborts manifest validation or theme installation with a message naming the offending theme id and field label.","triggerScenarios":"install_market_theme_from_base or validate_manifest sees a theme where one of name/version/author/license is whitespace-only, empty, or longer than its limit — e.g. a placeholder version string, an author field pasted with a long bio, or missing values defaulting to empty after JSON parse.","commonSituations":"Authors leaving draft fields empty when publishing; long SPDX expressions or URLs pasted into license; version strings like full git SHAs exceeding 40 chars; localized names with very long marketing text.","solutions":["Shorten the offending field in the manifest to within its limit (name/author/license ≤100 chars, version ≤40) and remove leading/trailing whitespace","Fill in any empty field with a meaningful value before publishing","If a version string is too long, use a short semver tag instead of a full commit SHA"],"exampleFix":"// before\n{ \"id\": \"cool-theme\", \"name\": \"\", \"version\": \"a1b2c3...full-64-char-sha\", ... }\n// after\n{ \"id\": \"cool-theme\", \"name\": \"Cool Theme\", \"version\": \"1.2.0\", ... }","handlingStrategy":"validation","validationCode":"fn text_field_ok(v: &str, max: usize) -> bool {\n    let t = v.trim();\n    !t.is_empty() && v.len() <= max\n}\n// name<=100, version<=40, author<=100, license<=100\nif ![(&theme.name,100),(&theme.version,40),(&theme.author,100),(&theme.license,100)]\n    .iter().all(|(v,max)| text_field_ok(v, *max)) {\n    return Err(anyhow::anyhow!(\"invalid name/version/author/license\"));\n}","typeGuard":null,"tryCatchPattern":"match install_market_theme(state_dir, &theme).await {\n    Ok(s) => println!(\"installed {}\", s.id),\n    Err(e) if e.to_string().contains(\"的\") && e.to_string().contains(\"无效\") => {\n        eprintln!(\"theme {} has an empty or over-length metadata field — fix the manifest\", theme.id);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Fill in all metadata fields before publishing; never ship placeholder empties","Cap version strings at short semver tags, not full SHAs","Enforce field length limits in the manifest generator","Trim whitespace in the publishing pipeline"],"tags":["marketplace","validation","limits"],"backgroundTag":"invalid-argument-value","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"}