BigPizzaV3/CodexPlusPlus · error
manifest.themeId 无效
Error message
manifest.themeId 无效
What it means
validate_manifest rejects the package when manifest.themeId is shorter than 3 or longer than 64 characters, or fails valid_theme_id's character-set check. The library enforces strict identifier rules because the themeId is used as a directory-safe identity key matching theme.json's id. The error is thrown during package validation before any theme is applied.
Solutions
- Open the package's manifest.json and shorten/lengthen themeId to 3-64 characters
- Remove any characters not accepted by valid_theme_id (keep it a simple identifier, e.g. [a-z0-9-] style)
- Ensure theme.json's top-level id matches the corrected themeId
- Repackage and re-validate with validate_and_read_package
Example fix
// before (manifest.json) "themeId": "My Theme!" // after "themeId": "my-theme-01"
Defensive patterns
Strategy: validation
Validate before calling
fn theme_id_ok(id: &str) -> bool {
let n = id.chars().count();
(3..=64).contains(&n) && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')
}
if !theme_id_ok(&manifest.theme_id) { /* fix before calling */ } Type guard
fn is_valid_theme_id(id: &str) -> bool {
let n = id.chars().count();
(3..=64).contains(&n) && id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')
} Try / catch
match validate_and_read_package(&path, platform) {
Err(e) if e.to_string().contains("themeId 无效") => {
eprintln!("package rejected: invalid themeId — regenerate manifest.json");
}
other => other?,
} Prevention
- Generate themeId programmatically from a slugifier, never by hand
- Keep ids as [a-z0-9-_], 3-64 chars
- Mirror the same id into theme.json's id field
When it happens
Trigger: Calling validate_and_read_package on a Dream Skin package whose manifest.json has a themeId with fewer than 3 or more than 64 characters, or containing characters outside the set allowed by valid_theme_id (e.g. spaces, slashes, non-ASCII, or invalid symbols).
Common situations: Hand-edited manifest.json; authoring tools that emit a display name instead of an id; renamed themes keeping punctuation; copy-pasted ids with trailing whitespace or unicode lookalikes.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/234be1c2d15f3028.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/dream_skin_package.rs:915
match name {
"manifest.json" => MANIFEST_LIMIT,
"theme.json" => THEME_LIMIT,
"theme.css" => CSS_LIMIT,
"LICENSE.txt" => LICENSE_LIMIT,
"manifest.sig" => SIGNATURE_LIMIT,
_ => IMAGE_LIMIT,
}
}
fn validate_manifest(manifest: &DreamSkinPackageManifest, platform: &str) -> anyhow::Result<()> {
if manifest.package_version != 1 || manifest.skin_api_version != 1 {
bail!("不支持的 Dream Skin 主题协议版本");
}
if manifest.theme_id.chars().count() < 3
|| manifest.theme_id.chars().count() > 64
|| !valid_theme_id(&manifest.theme_id)
{
bail!("manifest.themeId 无效");
}
if !valid_semver(&manifest.version) || !valid_semver(&manifest.min_client_version) {
bail!("manifest 版本号无效");
}
if compare_semver(&manifest.min_client_version, "1.5.12").is_gt() {
bail!(
"主题包需要更新版本的 Dream Skin 协议:{}",
manifest.min_client_version
);
}
if manifest.platforms.is_empty()
|| manifest.platforms.len() > 2
|| has_duplicates(&manifest.platforms)
|| manifest
.platforms
.iter()
.any(|item| !matches!(item.as_str(), "macos" | "windows"))
{View on GitHub (pinned to b1ed92e5e4)