{"record":{"id":"5a2252030fe989bd","repo":"Hmbown/CodeWhale","slug":"bridge-is-required-in-non-interactive-mode-bridge-choices","errorCode":null,"errorMessage":"--bridge is required in --non-interactive mode. {bridge_choices}","messagePattern":"--bridge is required in --non-interactive mode\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":170,"sourceCode":"        );\n    }\n    let idx = prompt_choice(\n        \"Cloud target\",\n        &CLOUD_TARGETS\n            .iter()\n            .map(|c| format!(\"{} ({})\", c.display, c.slug))\n            .collect::<Vec<_>>(),\n    )?;\n    Ok(&CLOUD_TARGETS[idx])\n}\n\nfn resolve_bridge(args: &RemoteSetupArgs) -> Result<&'static BridgeSpec> {\n    if let Some(slug) = &args.bridge {\n        return registry::bridge_by_slug(slug)\n            .ok_or_else(|| anyhow::anyhow!(\"unknown bridge '{slug}'. {}\", bridge_choices()));\n    }\n    if args.non_interactive {\n        bail!(\n            \"--bridge is required in --non-interactive mode. {}\",\n            bridge_choices()\n        );\n    }\n    let idx = prompt_choice(\n        \"Chat bridge\",\n        &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!(","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/remote_setup/mod.rs#L152-L188","documentation":"Remote setup (`resolve_bridge`) requires a chat bridge. With `--non-interactive` set and no `--bridge` slug given, the interactive picker cannot run, so the function bails and appends the list of valid bridge choices. This prevents headless runs from blocking on stdin.","triggerScenarios":"Running remote setup with `--non-interactive` while `--bridge <slug>` is missing; also surfaced through `unknown_flags_fail_with_choices` when flag resolution delegates to the non-interactive path.","commonSituations":"Automation scripts that specify the cloud but forget the bridge; containerized setups with no TTY where the prompt cannot be answered.","solutions":["Add `--bridge <slug>` with a valid bridge slug from the registry.","Drop `--non-interactive` to answer the 'Chat bridge' prompt interactively.","Use the bridge choices listed in the error message."],"exampleFix":"// before\ncodewhale remote-setup --non-interactive --cloud azure\n// after\ncodewhale remote-setup --non-interactive --cloud azure --bridge slack","handlingStrategy":"validation","validationCode":"if (args.nonInteractive && !args.bridge) throw new Error(`--bridge is required in --non-interactive mode`);","typeGuard":null,"tryCatchPattern":"try { runRemoteSetup(args) } catch (e) { if (String(e).includes('--bridge is required')) process.exitCode = 2; else throw e; }","preventionTips":["Include --bridge in every non-interactive invocation template","Pick slugs only from the registry choices in the error message","Verify flags survive shell templating/expansion"],"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"}