{"record":{"id":"9cc6fe21d6425339","repo":"Hmbown/CodeWhale","slug":"provider-is-required-in-non-interactive-mode-known-names","errorCode":null,"errorMessage":"--provider is required in --non-interactive mode. Known: {names_hint}","messagePattern":"--provider is required in --non-interactive mode\\. Known: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":195,"sourceCode":"        &BRIDGES\n            .iter()\n            .map(|b| format!(\"{} ({})\", b.display, b.slug))\n            .collect::<Vec<_>>(),\n    )?;\n    Ok(&BRIDGES[idx])\n}\n\nfn resolve_provider(args: &RemoteSetupArgs) -> Result<ProviderInfo> {\n    if let Some(slug) = &args.provider {\n        return ProviderInfo::from_slug(slug).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"unknown provider '{slug}'. Known: {}\",\n                codewhale_config::ProviderKind::names_hint()\n            )\n        });\n    }\n    if args.non_interactive {\n        bail!(\n            \"--provider is required in --non-interactive mode. Known: {}\",\n            codewhale_config::ProviderKind::names_hint()\n        );\n    }\n    // List providers by their canonical names from the existing registry.\n    let providers: Vec<ProviderInfo> = codewhale_config::ProviderKind::all()\n        .iter()\n        .filter_map(|kind| ProviderInfo::from_slug(kind.as_str()))\n        .collect();\n    let labels: Vec<String> = providers\n        .iter()\n        .map(|p| format!(\"{} ({})\", p.display, p.slug))\n        .collect();\n    let idx = prompt_choice(\"Model provider\", &labels)?;\n    Ok(providers[idx].clone())\n}\n\nfn cloud_choices() -> String {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/remote_setup/mod.rs#L177-L213","documentation":"Remote setup (`resolve_provider`) needs a provider kind. If `--provider` is not supplied while `--non-interactive` is active, the function bails and lists known provider names via `ProviderKind::names_hint()`. It enforces explicit provider selection in headless mode.","triggerScenarios":"Invoking remote setup with `--non-interactive` and no `--provider <name>`; also reached via `unknown_flags_fail_with_choices` on the non-interactive path.","commonSituations":"Scripted first-time setup that sets cloud and bridge but forgets the provider; CI jobs that migrated from interactive usage.","solutions":["Add `--provider <name>` using one of the names from the hint in the error.","Run interactively (remove `--non-interactive`) to pick from the registry list.","Verify provider spelling against `ProviderKind::names_hint()`."],"exampleFix":"// before\ncodewhale remote-setup --non-interactive --cloud azure --bridge slack\n// after\ncodewhale remote-setup --non-interactive --cloud azure --bridge slack --provider anthropic","handlingStrategy":"validation","validationCode":"if (args.nonInteractive && !args.provider) throw new Error(`--provider is required in --non-interactive mode`);","typeGuard":null,"tryCatchPattern":"try { runRemoteSetup(args) } catch (e) { if (String(e).includes('--provider is required')) process.exitCode = 2; else throw e; }","preventionTips":["Set all three of --cloud/--bridge/--provider for headless runs","Check ProviderKind names hint for accepted values","Keep setup scripts next to a checklist of required flags"],"tags":["cli","non-interactive","configuration"],"backgroundTag":"missing-required-flag","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}