{"record":{"id":"3be73bda760ce654","repo":"Hmbown/CodeWhale","slug":"provider-is-required-in-non-interactive-mode","errorCode":null,"errorMessage":"--provider is required in --non-interactive mode. Known: {}","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/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/remote_setup/mod.rs#L177-L213","documentation":"Remote setup resolves the model provider from --provider, an interactive prompt, or fails. In --non-interactive mode an omitted --provider is a hard error because there is no safe default across ProviderKind values. The message lists the known provider names via ProviderKind::names_hint().","triggerScenarios":"Running remote setup with --non-interactive and no --provider argument in resolve_provider (crates/tui/src/remote_setup/mod.rs). An unrecognized slug triggers the separate 'unknown provider' error.","commonSituations":"CI provisioning pipelines that migrated from interactive setup; renamed or newly added provider kinds whose slugs changed between versions; command templates copied from docs that assume a provider default.","solutions":["Add --provider <slug> to the command, choosing from the names printed by the error (ProviderKind::names_hint()).","Run interactively once to see the provider list and pick a value, then bake that slug into the non-interactive invocation.","If the slug is rejected as unknown, check the release notes for renamed ProviderKind values and update the flag."],"exampleFix":"# before\ncodewhale remote-setup --non-interactive --cloud <slug> --bridge <slug>\n# fails: --provider is required in --non-interactive mode\n\n# after\ncodewhale remote-setup --non-interactive --cloud <slug> --bridge <slug> --provider <slug>","handlingStrategy":"validation","validationCode":"# Shell: require provider for non-interactive setup\n: \"${CODEWHALE_PROVIDER:?--provider is required in --non-interactive mode; set CODEWHALE_PROVIDER}\"\ncodewhale remote-setup --non-interactive --cloud \"$CODEWHALE_CLOUD\" --bridge \"$CODEWHALE_BRIDGE\" --provider \"$CODEWHALE_PROVIDER\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --cloud, --bridge, and --provider as a mandatory triple in CI invocations.","Validate provider slugs against the names listed by the CLI after each upgrade.","Prefer failing in your own wrapper with a clear message over relying on the CLI's runtime error."],"tags":["cli","remote-setup","non-interactive","provider","rust"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}