{"record":{"id":"b91855c46ba1084b","repo":"Hmbown/CodeWhale","slug":"unknown-bridge-slug","errorCode":null,"errorMessage":"unknown bridge '{slug}'. {}","messagePattern":"unknown bridge '(.+?)'\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":167,"sourceCode":"        bail!(\n            \"--cloud is required in --non-interactive mode. {}\",\n            cloud_choices()\n        );\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> {","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/remote_setup/mod.rs#L149-L185","documentation":"resolve_bridge resolves the --bridge flag through registry::bridge_by_slug and throws with the list of valid bridge choices when the slug is unknown. Like resolve_cloud, it is the first-line validation of the remote setup flags.","triggerScenarios":"Running remote setup with `--bridge <slug>` where slug is misspelled, stale, or absent from BRIDGES registry.","commonSituations":"Typos, renamed bridge slugs in a newer version, or scripts written against a different installation.","solutions":["Use a slug from the bridge_choices() list printed with the error","Omit --bridge to pick interactively (unless --non-interactive)","Verify available slugs in the registry/help output","Update tooling to current slug names after upgrades"],"exampleFix":"// before\ncodewhale remote-setup --bridge taisl\n// after\ncodewhale remote-setup --bridge tailscale","handlingStrategy":"validation","validationCode":"let slug = args.bridge.as_deref().unwrap_or(\"\");\nif registry::bridge_by_slug(slug).is_none() {\n    eprintln!(\"--bridge must be one of: {}\", BRIDGE_CHOICES.join(\", \"));\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_remote_setup(args) {\n    if e.to_string().starts_with(\"unknown bridge\") {\n        eprintln!(\"{e}\");\n        std::process::exit(2);\n    }\n    return Err(e);\n}","preventionTips":["Validate --bridge against bridge_choices() before invoking","Keep deployment scripts in sync with registry slug names","Prefer interactive selection for one-off setups","Pin script inputs to documented slugs and assert them early"],"tags":["cli","validation","slug","remote-setup"],"backgroundTag":"invalid-cli-argument","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"}