{"record":{"id":"7806c68df95b777c","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-7806c6","errorCode":null,"errorMessage":"市场主题 {} 包含无效标签","messagePattern":"市场主题 (.+?) 包含无效标签","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":225,"sourceCode":"    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)?;\n    Ok(())\n}\n\nfn market_http_client() -> anyhow::Result<reqwest::Client> {\n    Ok(reqwest::Client::builder()\n        .user_agent(format!(\n            \"CodexPlusPlus-Themes/{}\",","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_market.rs#L207-L243","documentation":"validate_market_theme enforces per-field length and non-empty rules for name/version/author/license, then description ≤500 bytes and ≤12 tags. This specific bail fires when any entry in theme.tags is empty after trimming or longer than 32 bytes — a generic validation sentinel protecting market metadata from junk or oversized labels.","triggerScenarios":"install_market_theme_from_base or validate_manifest processes a theme whose tags array contains \"\", \"   \", or a tag exceeding 32 chars — e.g. a generator that appends empty strings or splits a long phrase with a non-standard separator.","commonSituations":"Hand-edited manifests with a trailing empty tag; a publishing script joining keywords into one overlong tag; localization pipelines inserting blank tags for untranslated entries.","solutions":["Remove empty/whitespace tags and shorten any tag longer than 32 characters in the manifest","Fix the manifest generation script to filter blank tags and cap tag length","Republish the manifest and retry the install"],"exampleFix":"// before\n{ \"id\": \"cool-theme\", \"tags\": [\"dark\", \"\", \"an-extremely-long-tag-description-over-32-chars\"] }\n// after\n{ \"id\": \"cool-theme\", \"tags\": [\"dark\", \"minimal\"] }","handlingStrategy":"validation","validationCode":"fn tags_ok(tags: &[String]) -> bool {\n    tags.iter().all(|t| !t.trim().is_empty() && t.len() <= 32)\n}\nif !tags_ok(&theme.tags) {\n    return Err(anyhow::anyhow!(\"theme {} has invalid tags\", theme.id));\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 {} has empty or over-length tags — clean the manifest\", theme.id);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Filter out blank tags in the manifest generator","Cap tag length at 32 chars at publish time","Normalize tag input (trim, lowercase) before writing manifests","Validate tags in publisher CI"],"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"}