{"record":{"id":"3034c7d7db12856f","repo":"Hmbown/CodeWhale","slug":"dsh-profile-must-be-web-headless-or-bu","errorCode":null,"errorMessage":"DSH profile must be `web`, `headless`, or `{}` (bundle), got `{profile}`","messagePattern":"DSH profile must be `web`, `headless`, or `(.+?)` \\(bundle\\), got `(.+?)`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/mod.rs","lineNumber":715,"sourceCode":"            DshIntegrationState::NotInstalled => anyhow::bail!(\"dsh is not installed\"),\n            DshIntegrationState::Detected { .. } => {\n                anyhow::bail!(\"DSH is detected but not connected; run `{CLI_COMMAND} connect`\")\n            }\n        }\n    }\n    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());","sourceCodeStart":697,"sourceCodeEnd":733,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/integrations/dsh/mod.rs#L697-L733","documentation":"launch_spec validates the DSH profile name before building the launch command. Only the built-in `web` and `headless` profiles plus the dedicated bundle profile (bundle::BUNDLE_PROFILE) are accepted; any other `--profile` override (or a stored record.profile that is not one of these) is rejected with this message.","triggerScenarios":"Calling a dsh launch command with `--profile <name>` where <name> is neither `web`, `headless`, nor the bundle profile name; or the connected record's stored profile field holds an unexpected value.","commonSituations":"Typo in the profile flag (`webs`, `Web`, `terminal`); copying a dsh-native profile name that Codewhale's integration does not whitelist; an old receipt written by a previous Codewhale version with a since-removed profile name.","solutions":["Re-run with `--profile web` or `--profile headless` (or omit the override to use the default).","Use the bundle profile name shown in the error only after `codewhale dsh install-bundle`.","If the error comes from a stored record (no explicit override), run `codewhale dsh connect` again to rewrite the record with a valid profile.","Check `codewhale dsh launch --help` for the accepted profile values."],"exampleFix":"// before\ncodewhale dsh launch --profile terminal\n\n// after\ncodewhale dsh launch --profile headless","handlingStrategy":"validation","validationCode":"const VALID_PROFILES: &[&str] = &[\"web\", \"headless\"];\nif let Some(p) = profile_override {\n    if !VALID_PROFILES.contains(&p) && p != bundle::BUNDLE_PROFILE {\n        return Err(format!(\"unsupported profile {p}\"));\n    }\n}","typeGuard":"fn is_valid_profile(p: &str) -> bool {\n    matches!(p, \"web\" | \"headless\") || p == bundle::BUNDLE_PROFILE\n}","tryCatchPattern":"match launch_spec(&report, profile_override, &[], &ws) {\n    Err(e) if e.to_string().starts_with(\"DSH profile must be\") => {\n        eprintln!(\"use --profile web or --profile headless\");\n    }\n    other => other?,\n}","preventionTips":["Whitelist profile values in CLI arg parsing before reaching launch_spec.","Only pass profiles sourced from dsh status output, not free user text.","Reconnect after upgrading Codewhale if a stored profile name changed."],"tags":["dsh","profile","invalid-argument","cli"],"backgroundTag":"invalid-enum-value","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"}