BigPizzaV3/CodexPlusPlus · error
Dream Skin theme id does not match directory
Error message
Dream Skin theme id does not match directory
What it means
After successfully parsing the stored config JSON, load_stored_dream_skin_theme requires that config.id equals the directory-name id argument. A mismatch bails with "Dream Skin theme id does not match directory" — the on-disk identity must be self-consistent before the theme is used, renamed, or deleted.
Solutions
- Edit themes/<id>/theme.json so its "id" equals the directory name <id>
- Use the library's rename_dream_skin_theme API instead of renaming directories on disk
- Delete the inconsistent directory and recreate the theme through the public API
- When forking a theme manually, update both the folder name and the config id together
Example fix
// before
// themes/ocean/theme.json -> { "id": "sunset", ... }
// after
// themes/ocean/theme.json -> { "id": "ocean", ... } Defensive patterns
Strategy: validation
Validate before calling
let cfg: DreamSkinThemeConfig = serde_json::from_slice(&std::fs::read(themes_dir.join(id).join("theme.json"))?)?;
if cfg.id != id {
return Err(anyhow::anyhow!("config id '{}' does not match directory '{id}'", cfg.id));
} Type guard
fn ids_are_consistent(dir_name: &str, cfg: &DreamSkinThemeConfig) -> bool {
cfg.id == dir_name
} Try / catch
match load_stored_dream_skin_theme(&state_dir, &id) {
Ok(draft) => use(draft),
Err(e) if e.to_string().contains("does not match directory") => eprintln!("fix the 'id' in themes/{id}/theme.json to equal '{id}', or recreate the theme"),
Err(e) => return Err(e.into()),
} Prevention
- Always rename themes via rename_dream_skin_theme, never by renaming folders
- When duplicating a theme to fork it, update the inner config id to the new name
- Run a consistency pass over the themes directory after backups or manual edits
When it happens
Trigger: theme.json inside themes/<id>/ contains an id field different from <id> — typically after the directory was renamed manually, the id was hand-edited, or a theme was copied to a new folder name without updating its config.
Common situations: Duplicating a theme folder to "fork" it but forgetting to change the inner id; renaming via the file manager instead of rename_dream_skin_theme; merging theme directories from backups where names collide.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- 同 ID 本地主题身份不一致,已拒绝覆盖
- sidebar catalog row thread_id does not match snapshot
- 主题包必须是 32 MiB 以内的普通 ZIP 文件
- 请填写 API 的模型名称
- 官方混合 API 不应在 auth.json 中保存 OPENAI_API_KEY。请清理此供应商的…
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/66c84b2cc2b32be7.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/dream_skin_library.rs:390
}
let directory = state_dir.join(THEMES_DIR).join(id);
let metadata = std::fs::symlink_metadata(&directory)
.with_context(|| format!("Dream Skin theme not found: {id}"))?;
if !metadata.file_type().is_dir() || metadata.file_type().is_symlink() {
bail!("Dream Skin theme path is not a safe directory");
}
let config_path = directory.join(THEME_CONFIG_FILE);
let metadata = std::fs::symlink_metadata(&config_path)
.with_context(|| format!("Dream Skin theme config not found: {id}"))?;
if !metadata.file_type().is_file()
|| metadata.file_type().is_symlink()
|| metadata.len() > THEME_CONFIG_LIMIT
{
bail!("invalid Dream Skin theme config");
}
let config: DreamSkinThemeConfig = serde_json::from_slice(&std::fs::read(&config_path)?)?;
if config.id != id {
bail!("Dream Skin theme id does not match directory");
}
let image = find_theme_image(&directory)
.ok_or_else(|| anyhow::anyhow!("Dream Skin theme must contain exactly one image"))?;
let draft = DreamSkinThemeDraft {
config,
image_path: image.to_string_lossy().into_owned(),
builtin: false,
};
validate_theme_draft(&draft)?;
Ok(draft)
}
pub fn rename_dream_skin_theme(
state_dir: &Path,
id: &str,
name: &str,
) -> anyhow::Result<DreamSkinThemeSummary> {
let mut draft = load_stored_dream_skin_theme(state_dir, id)?;View on GitHub (pinned to b1ed92e5e4)