BigPizzaV3/CodexPlusPlus · error
主题包只能包含唯一一层主题目录
Error message
主题包只能包含唯一一层主题目录
What it means
Layout guard in normalize_package_entries: entries live under directories but not a single consistent one — either the derived prefix is empty, some entries lack the prefix, or a file sits deeper than one level below it. Only one flat top-level theme directory is allowed.
Source
Thrown at crates/codex-plus-core/src/dream_skin_package.rs:862
let prefix = if root_files {
if content_entries.iter().any(|(name, _)| name.contains('/')) {
bail!("主题包文件必须全部位于根目录或唯一一层主题目录");
}
None
} else {
let prefix = content_entries[0]
.0
.split_once('/')
.map(|(prefix, _)| prefix)
.context("主题包顶级目录无效")?;
if prefix.is_empty()
|| content_entries.iter().any(|(name, _)| {
name.split_once('/').is_none_or(|(candidate, file)| {
candidate != prefix || file.is_empty() || file.contains('/')
})
})
{
bail!("主题包只能包含唯一一层主题目录");
}
Some(format!("{prefix}/"))
};
let mut files = std::collections::BTreeMap::new();
for (name, content) in content_entries {
let normalized = prefix
.as_deref()
.and_then(|prefix| name.strip_prefix(prefix))
.unwrap_or(&name)
.to_string();
if files.insert(normalized.clone(), content).is_some() {
bail!("主题包包含重复文件:{normalized}");
}
}
Ok(files)
}
View on GitHub (pinned to f2074595a2)
Solutions
- Put every file inside one named theme directory, one level deep
- Remove extra nesting levels and unrelated top-level folders
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:862 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23).
Data as JSON: /api/errors/6429acbe711805be.
Report an issue: GitHub.