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

The serve flag matrix treats --web (the loopback-only web UI) as mutually exclusive with both --http and --mobile. All three select the HTTP transport, but web mode has its own hard loopback constraint while mobile mode deliberately widens the bind, so combining them produces contradictory bind semantics and is rejected before the server starts.

Source

Thrown at crates/tui/src/lib.rs:1287

        (false, None) => ServeBindHost {
            host: "127.0.0.1".to_string(),
            mobile_rebound_to_lan: false,
        },
    }
}

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 0c42157ee5)

Solutions

  1. Choose exactly one HTTP flavor: --web, --http, or --mobile
  2. Run a second codewhale serve process on another port if you genuinely need two HTTP surfaces
  3. Fix wrapper scripts so exactly one of the three flags is emitted

Example fix

# before
codewhale serve --web --mobile

# after
codewhale serve --web           # loopback-only web UI
Defensive patterns

Strategy: validation

Validate before calling

count=0
$WEB    && count=$((count+1))
$HTTP   && count=$((count+1))
$MOBILE && count=$((count+1))
[ "$count" -gt 1 ] && { echo 'choose one of --web/--http/--mobile'; exit 2; }

Type guard

fn web_http_disjoint(web: bool, http: bool, mobile: bool) -> bool {
    !(web && (http || mobile))
}

Prevention

When it happens

Trigger: `codewhale serve --web --http`, `codewhale serve --web --mobile`; scripts or docs that append mode flags cumulatively; enabling a web UI plus mobile remote control in one invocation.

Common situations: Copy-paste layering of flags from different docs; toggling between UI modes without clearing the previous flag; config-driven launchers that pass every enabled mode at once.

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


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/ffb78eb39ba20ff8. Report an issue: GitHub.