Hmbown/CodeWhale · error · anyhow::Error
--web is mutually exclusive with --http and --mobile
Error message
--web is mutually exclusive with --http and --mobile
What it means
validate_serve_mode_selection: --web was combined with --http or --mobile; the web serve mode replaces rather than composes with those listeners, so the combination is rejected during CLI validation before any server starts.
Solutions
- Choose only --web, or only --http/--mobile, per invocation
- Run two separate codewhale serve processes if both surfaces are genuinely needed
- Use --web alone if the web interface was the goal
Example fix
// before codewhale serve --web --http // after codewhale serve --web
Defensive patterns
Strategy: validation
Validate before calling
if web && (http || mobile) { eprintln!("--web cannot be combined"); std::process::exit(2); } Try / catch
match result { Err(e) if e.to_string().contains("--web is mutually exclusive") => { eprintln!("{}", e); std::process::exit(2); }, other => other? } Prevention
- Pick one server surface per process; spawn separate processes for more
- Keep flag sets in scripts minimal and generated from a single selection
- Check help output before combining serve flags
When it happens
Trigger: Invoking a serve/server subcommand with `--web` alongside `--http` or `--mobile` (e.g. `codewhale serve --web --http`).
Common situations: Wanting both the web UI and raw HTTP endpoint at once in one process; scripted flag accumulation; outdated docs or muscle memory from other tools.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- Choose exactly one server mode: --mcp…
- --http and --mobile are mutually exclusive; choose one
- `codewhale --continue` resumes the interactive TUI. Use…
- `codewhale --resume ` resumes the interactive TUI. Use…
- --continue/--resume/--session-id apply to the interactive…
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/ffb78eb39ba20ff8.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/lib.rs:1404
fn resolve_serve_bind_host(_mobile: bool, host: Option<String>) -> ServeBindHost {
ServeBindHost {
host: host.unwrap_or_else(|| "127.0.0.1".to_string()),
}
}
fn validate_serve_mode_selection(
mcp: bool,
http: bool,
mobile: bool,
web: bool,
acp: bool,
) -> Result<bool> {
if http && mobile {
bail!("--http and --mobile are mutually exclusive; choose one");
}
if web && (http || mobile) {
bail!("--web is mutually exclusive with --http and --mobile");
}
let http_selected = http || mobile || web;
let selected_modes = [mcp, http_selected, acp]
.into_iter()
.filter(|selected| *selected)
.count();
if selected_modes != 1 {
bail!("Choose exactly one server mode: --mcp, --http/--mobile/--web, or --acp");
}
Ok(http_selected)
}
#[derive(Subcommand, Debug, Clone)]
enum McpCommand {
/// List configured MCP servers
List,
/// Create a template MCP config at the configured path
Init {View on GitHub (pinned to 73e0f67d83)