{"record":{"id":"ba4f87ff356a7745","repo":"Hmbown/CodeWhale","slug":"overlay-could-not-be-rendered","errorCode":null,"errorMessage":"overlay could not be rendered","messagePattern":"overlay could not be rendered","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":374,"sourceCode":"}\n\npub(crate) fn plan(\n    paths: &DshPaths,\n    detection: &DshDetection,\n    identity: &CodewhaleRouteIdentity,\n    profile: &str,\n    allow_full_access: bool,\n    skin: bool,\n    ocean: bool,\n) -> Result<DshPlan> {\n    let mapped = map_identity(identity, allow_full_access);\n    let overlay_text = render_overlay(&mapped).ok_or_else(|| match &mapped.adapter {\n        DshAdapter::Unsupported { reason } => anyhow::anyhow!(\n            \"current Codewhale route {}/{} cannot be carried by DSH: {reason}\",\n            identity.provider_id,\n            identity.model\n        ),\n        _ => anyhow::anyhow!(\"overlay could not be rendered\"),\n    })?;\n    let overlay_sha256 = sha256_hex(overlay_text.as_bytes());\n    let mut disclosures = mapped.disclosures.clone();\n    let shadowing = shadowing_namespaces(detection);\n    if !shadowing.is_empty() {\n        disclosures.push(format!(\n            \"$DSH_HOME/settings.yaml has [{}] sections; DSH layers those over the overlay per field, so the saved DSH selection can shadow the pinned identity until you clear it in DSH.\",\n            shadowing.join(\", \")\n        ));\n    }\n    if !detection.profiles.iter().any(|p| p == profile) {\n        disclosures.push(format!(\n            \"DSH profile `{profile}` is not initialized yet; dsh will create $DSH_HOME/profiles/{profile} on first launch (its own documented behavior).\"\n        ));\n    }\n    if skin {\n        disclosures.push(\n            \"Skin: Codewhale palette is applied through the bundle profile via overrideTokens (on by default for install-bundle). The --patch overlay path is unchanged; launch --profile web|headless stays overlay-only.\"","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/mod.rs#L356-L392","documentation":"`plan` renders the overlay configuration text; when `render_overlay` returns None for a reason other than an explicitly Unsupported adapter (the match falls to the `_` arm), it throws this generic error. It signals an internal gap: the adapter was considered supported/mapped, but no overlay could be produced.","triggerScenarios":"`render_overlay(&mapped)` returns `None` while `mapped.adapter` is not `DshAdapter::Unsupported` — e.g. a supported adapter whose identity fields (URL, key slot, params) fail overlay template rendering.","commonSituations":"Identity mapping produced a partially populated adapter (missing base URL or credential field the overlay template requires); a new DshAdapter variant added without a render_overlay arm; edge-case identity fields the renderer doesn't handle.","solutions":["Inspect the mapped identity/provider fields — ensure base URL and required credentials are present in the route config.","Retry after correcting the provider/model configuration so the adapter is fully populated.","If it persists, it's a code gap: add the missing `render_overlay` arm/handler for the adapter variant and file an issue with the route details.","As a workaround, run codewhale without the DSH overlay for this route."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if render_overlay(&mapped).is_none() && !matches!(mapped.adapter, DshAdapter::Unsupported { .. }) {\n    eprintln!(\"overlay rendering failed for a mapped adapter; check route fields (base URL, credentials)\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match plan(&identity, allow_full_access, skin, ocean) {\n    Err(e) if e.to_string().contains(\"overlay could not be rendered\") => {\n        eprintln!(\"overlay render failed; verify provider config is fully populated\");\n    }\n    other => other?,\n}","preventionTips":["Ensure route config includes all fields the overlay template needs (URL, key slot)","Add a render_overlay arm whenever a new DshAdapter variant is introduced","Log the mapped adapter variant when rendering fails to speed diagnosis"],"tags":["dsh","overlay","rendering"],"backgroundTag":"internal-invariant-violation","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}