{"record":{"id":"0b38147d8f32ebe5","repo":"Hmbown/CodeWhale","slug":"the-profile-carries-identity-only-after-cli","errorCode":null,"errorMessage":"the `{}` profile carries identity only after `{CLI_COMMAND} install-bundle`","messagePattern":"the `(.+?)` profile carries identity only after `(.+?) install-bundle`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":721,"sourceCode":"    let binary = report\n        .detection\n        .binary\n        .clone()\n        .ok_or_else(|| anyhow::anyhow!(\"dsh binary path is unknown\"))?;\n    let bundle_installed = record.bundle.is_some();\n    let profile = profile_override.unwrap_or(if bundle_installed {\n        bundle::BUNDLE_PROFILE\n    } else {\n        record.profile.as_str()\n    });\n    if !matches!(profile, \"web\" | \"headless\") && profile != bundle::BUNDLE_PROFILE {\n        anyhow::bail!(\n            \"DSH profile must be `web`, `headless`, or `{}` (bundle), got `{profile}`\",\n            bundle::BUNDLE_PROFILE\n        );\n    }\n    if profile == bundle::BUNDLE_PROFILE && !bundle_installed {\n        anyhow::bail!(\n            \"the `{}` profile carries identity only after `{CLI_COMMAND} install-bundle`\",\n            bundle::BUNDLE_PROFILE\n        );\n    }\n    let mut args = vec![\"--profile\".to_string(), profile.to_string()];\n    if profile != bundle::BUNDLE_PROFILE {\n        // The dedicated bundle profile carries the identity itself; the\n        // shipped profiles get it through the overlay.\n        args.push(\"--patch\".to_string());\n        args.push(report.overlay_path.display().to_string());\n    }\n    args.extend(extra_args.iter().cloned());\n    let provider_env_vars: Vec<String> =\n        record.identity.source.api_key_env.iter().cloned().collect();\n    let strip_env = launch_env_strip_list(\n        crate::config::cli_api_key_source().as_deref(),\n        &provider_env_vars,\n    );","sourceCodeStart":703,"sourceCodeEnd":739,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/mod.rs#L703-L739","documentation":"The dedicated bundle profile is special: it carries the Codewhale identity inside the installed bundle itself. launch_spec rejects requesting that profile when no bundle is actually installed — without `install-bundle` the profile exists but has no identity to launch with.","triggerScenarios":"Passing the bundle profile name (bundle::BUNDLE_PROFILE) as `--profile` to a dsh launch command while record.bundle is None, i.e. `codewhale dsh install-bundle` was never run (or remove-bundle was run).","commonSituations":"Scripting a launch with the bundle profile on a machine where the bundle step was skipped; running remove-bundle and then launching with a stale script that still names the bundle profile.","solutions":["Run `codewhale dsh install-bundle` to install the bundle into the dedicated profile, then launch again.","Or launch with `--profile web`/`--profile headless`, which receive identity through the overlay patch instead.","Check `codewhale dsh status` to confirm whether the bundle is installed."],"exampleFix":"// before\ncodewhale dsh launch --profile codewhale\nError: the `codewhale` profile carries identity only after `codewhale install-bundle`\n\n// after\ncodewhale dsh install-bundle\ncodewhale dsh launch --profile codewhale","handlingStrategy":"validation","validationCode":"let status = codewhale_dsh_status()?;\nlet bundle_installed = status.record.as_ref().and_then(|r| r.bundle.as_ref()).is_some();\nif profile_override == Some(bundle::BUNDLE_PROFILE) && !bundle_installed {\n    return Err(\"bundle profile requires install-bundle first\");\n}","typeGuard":"fn bundle_profile_ready(status: &DshStatusReport) -> bool {\n    status.record.as_ref().map_or(false, |r| r.bundle.is_some())\n}","tryCatchPattern":"match launch_spec(&report, Some(bundle::BUNDLE_PROFILE), &[], &ws) {\n    Err(e) if e.to_string().contains(\"install-bundle\") => {\n        run_install_bundle()?;\n        launch_spec(&report, Some(bundle::BUNDLE_PROFILE), &[], &ws)?;\n    }\n    other => other?,\n}","preventionTips":["Run install-bundle before scripting launches with the bundle profile.","Check bundle presence via `codewhale dsh status` in scripts.","Remember remove-bundle invalidates the bundle profile until reinstall."],"tags":["dsh","bundle","profile","prerequisite"],"backgroundTag":"missing-prerequisite","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"}