Yeachan-Heo/oh-my-codex · error · Error

Conflicting setup Team mode flags: ${source} selects ${next}

Error message

Conflicting setup Team mode flags: ${source} selects ${next}, but another flag already selected ${value}

What it means

Team mode flags are mutually exclusive: once a flag selects `enabled` or `disabled`, a later flag selecting the other value throws. Mirrors the install/MCP mode conflict guards.

Source

Thrown at src/cli/index.ts:701

    }
    if (arg.startsWith("--scope=")) {
      value = arg.slice("--scope=".length);
    }
  }
  if (!value) return undefined;
  if (SETUP_SCOPES.includes(value as SetupScope)) {
    return value as SetupScope;
  }
  throw new Error(
    `Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(", ")}`,
  );
}

export function resolveSetupTeamModeArg(args: string[]): SetupTeamMode | undefined {
  let value: SetupTeamMode | undefined;
  const setValue = (next: SetupTeamMode, source: string): void => {
    if (value && value !== next) {
      throw new Error(
        `Conflicting setup Team mode flags: ${source} selects ${next}, but another flag already selected ${value}`,
      );
    }
    value = next;
  };
  const parseValue = (next: string): SetupTeamMode => {
    if (!SETUP_TEAM_MODES.includes(next as SetupTeamMode)) {
      throw new Error(
        `Invalid setup Team mode: ${next}. Expected one of: enabled, disabled`,
      );
    }
    return next as SetupTeamMode;
  };

  for (let index = 0; index < args.length; index += 1) {
    const arg = args[index];
    if (arg === "--disable-team" || arg === "--no-team") {
      setValue("disabled", arg);

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Keep only one Team mode selection
  2. Use `--team-mode=<value>` once

Example fix

# before
omx setup --team --no-team
# after
omx setup --no-team
Defensive patterns

Strategy: validation

Validate before calling

const teamFlags = args.filter(a => a === '--team' || a === '--no-team' || a.startsWith('--team-mode'));
if (teamFlags.length > 1) throw new Error('conflicting Team flags');

Type guard

const isSetupTeamMode = (v: string): v is SetupTeamMode => ['enabled','disabled'].includes(v);

Try / catch

catch (e) { if (/Conflicting setup Team mode/.test(e.message)) /* keep --team-mode=value only */ }

Prevention

When it happens

Trigger: `omx setup --team --no-team`, or `--team-mode enabled --no-team`.

Common situations: Scripted defaults combined with explicit user flags; aliases injecting team flags.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/a59c9aa236a46964. Report an issue: GitHub.