{"record":{"id":"4fa5cf90a01789e7","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-4fa5cf","errorCode":null,"errorMessage":"市场主题 {} 的描述或标签数量超过限制","messagePattern":"市场主题 (.+?) 的描述或标签数量超过限制","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":218,"sourceCode":"    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] {\n        validate_market_path(path)?;\n    }\n    validate_sha256(&theme.theme_sha256)?;\n    validate_sha256(&theme.image_sha256)?;","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_market.rs#L200-L236","documentation":"validate_market_theme enforces size limits on the free-form description (≤500 chars) and the number of tags (≤12). Exceeding either bound aborts manifest validation or installation so market payloads stay bounded.","triggerScenarios":"install_market_theme_from_base or validate_manifest encounters a theme whose description length exceeds 500 characters or whose tags array has more than 12 entries — commonly from auto-generated descriptions or publishers tagging exhaustively.","commonSituations":"A publisher pastes a full README as the description; a manifest generator adds every keyword as a tag; migrated legacy catalog data with unbounded fields.","solutions":["Trim the description to ≤500 characters (move long text to the theme's source page)","Reduce the tags array to at most 12 of the most relevant tags","Regenerate the manifest with a publishing script that clamps these fields"],"exampleFix":"// before\n{ \"id\": \"cool-theme\", \"description\": \"<2000 chars>\", \"tags\": [\"a\",\"b\", ... 20 tags] }\n// after\n{ \"id\": \"cool-theme\", \"description\": \"Short summary (<500 chars)\", \"tags\": [\"dark\",\"minimal\"] }","handlingStrategy":"validation","validationCode":"if theme.description.len() > 500 {\n    return Err(anyhow::anyhow!(\"description too long ({} > 500)\", theme.description.len()));\n}\nif theme.tags.len() > 12 {\n    return Err(anyhow::anyhow!(\"too many tags ({})\", theme.tags.len()));\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(\"描述或标签\") => {\n        eprintln!(\"theme {} exceeds description/tag limits — trim before publishing\", theme.id);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep descriptions under 500 chars; link to full docs instead","Limit tags to 12 relevant keywords at publish time","Clamp/validate these fields in the manifest generator and CI"],"tags":["marketplace","validation","limits"],"backgroundTag":"value-out-of-range","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"}