BigPizzaV3/CodexPlusPlus · critical

dream skin target renderer contains unresolved placeholders

Error message

dream skin target renderer contains unresolved placeholders

What it means

The dream-skin renderer HTML is a template containing placeholders such as __DREAM_SKIN_VERSION_JSON__, __DREAM_SKIN_STYLE_REVISION_JSON__ and __DREAM_SKIN_PAYLOAD_REVISION_JSON__. After the replacement pass, the code asserts that no `__DREAM_` or `__GLASS_VISION_` tokens remain and panics otherwise. This panic means the embedded template contains a placeholder the Rust replacement chain does not know about - an internal template/code version mismatch, not a bad runtime input.

Source

Thrown at crates/codex-plus-core/src/assets.rs:165

        )
        .replace(
            "__DREAM_SKIN_THEME_JSON__",
            "window.__CODEX_PLUS_DREAM_SKIN_THEME__",
        )
        .replace(
            "__DREAM_SKIN_VERSION_JSON__",
            &serde_json::to_string("1.2.0").unwrap(),
        )
        .replace(
            "__DREAM_SKIN_STYLE_REVISION_JSON__",
            &serde_json::to_string(&style_revision).unwrap(),
        )
        .replace(
            "__DREAM_SKIN_PAYLOAD_REVISION_JSON__",
            &serde_json::to_string(&payload_revision).unwrap(),
        );
    if payload.contains("__DREAM_") || payload.contains("__GLASS_VISION_") {
        panic!("dream skin target renderer contains unresolved placeholders");
    }

    let art_assignment = include_art.then(|| {
        format!(
            "window.__CODEX_PLUS_DREAM_SKIN_ART__ = {};\n",
            serde_json::to_string(&dream_skin_art_data_uri(settings))
                .expect("dream skin target art should serialize")
        )
    });
    let skin_api_bootstrap = dream_skin_skin_api_bootstrap_script(&theme);
    payload = format!(
        "(() => {{\nwindow.__CODEX_PLUS_EXTERNAL_DREAM_SKIN_RUNTIME__ = true;\nwindow.__CODEX_PLUS_CLEAR_DREAM_SKIN__?.();\n{}window.__CODEX_PLUS_DREAM_SKIN_ART_SIGNATURE__ = {};\nwindow.__CODEX_PLUS_DREAM_SKIN_THEME__ = {};\nwindow.__CODEX_PLUS_DREAM_SKIN_RUNTIME_REVISION__ = {};\nwindow.__CODEX_PLUS_DREAM_SKIN_TARGET_ENGINE__ = {};\n{}const result = {};\nconst state = window.__CODEX_DREAM_SKIN_STATE__ || window.__CODEX_GLASS_VISION_SKIN_STATE__;\nif (state) {{\n  state.version = `codex-plus:${{String(window.__CODEX_PLUS_DREAM_SKIN_PLATFORM__ || 'unknown')}}:${{window.__CODEX_PLUS_DREAM_SKIN_TARGET_ENGINE__}}:r${{window.__CODEX_PLUS_DREAM_SKIN_RUNTIME_REVISION__}}`;\n  state.observer?.disconnect?.();\n  if (state.timer) clearInterval(state.timer);\n  state.observer = null;\n  state.timer = null;\n}}\nwindow.__CODEX_PLUS_DREAM_SKIN_PAYLOAD_SIGNATURE__ = {};\nreturn result;\n}})()",
        art_assignment.unwrap_or_default(),
        serde_json::to_string(&dream_skin_art_content_signature(settings)).unwrap(),
        theme,
        serde_json::to_string(DREAM_SKIN_RENDERER_REVISION).unwrap(),
        serde_json::to_string(engine).unwrap(),
        skin_api_bootstrap,

View on GitHub (pinned to fb3ebd9a82)

Solutions

  1. cargo clean and rebuild to rule out a stale embedded template
  2. Inspect the template (or dump the payload) and grep for __DREAM_ and __GLASS_VISION_ to identify the exact unresolved token
  3. Add the missing .replace("__YOUR_TOKEN__", &serde_json::to_string(value).unwrap()) entry next to the existing ones, or remove the token from the template
  4. Add a unit test that renders the payload and asserts it contains no __DREAM_/__GLASS_VISION_ substrings

Example fix

// template uses: const rev = __DREAM_SKIN_ART_REVISION_JSON__;
// before - no matching replace, so the final contains-check panics

// after - add the replacement before the __DREAM_ / __GLASS_VISION_ check
payload = payload.replace(
    "__DREAM_SKIN_ART_REVISION_JSON__",
    &serde_json::to_string(&art_revision).unwrap(),
);
Defensive patterns

Strategy: validation

Validate before calling

// CI guard: render the payload and assert no tokens remain
#[test]
fn dream_skin_payload_has_no_unresolved_placeholders() {
    let payload = dream_skin_renderer_payload(&Default::default(), false);
    assert!(!payload.contains("__DREAM_"), "unresolved __DREAM_ placeholder");
    assert!(!payload.contains("__GLASS_VISION_"), "unresolved __GLASS_VISION_ placeholder");
}

Try / catch

// Only if a skin build must never take down the host process
let payload = std::panic::catch_unwind(|| build_dream_skin_payload(&settings))
    .map_err(|p| anyhow::anyhow!("dream skin build panicked: {:?}", p.downcast_ref::<&str>()))?;

Prevention

When it happens

Trigger: Editing the bundled skin HTML to add a new __DREAM_*__ or __GLASS_VISION_*__ placeholder without adding the matching .replace() call in assets.rs; renaming a placeholder on only one side; a stale mixed build after a partial rebase where template and replacement code come from different commits.

Common situations: Fork work on the dream-skin feature; merging upstream skin changes; incremental build artifacts caching the old embedded template via include_str!/include_bytes!.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@fb3ebd9a82 (2026-08-17). Data as JSON: /api/errors/743d3077c8a7370f. Report an issue: GitHub.