Yeachan-Heo/oh-my-codex · error · Error
Invalid setup Team mode: ${next}. Expected one of: enabled,
Error message
Invalid setup Team mode: ${next}. Expected one of: enabled, disabled What it means
The Team mode value must be `enabled` or `disabled` (SETUP_TEAM_MODES). Supplied via --team-mode <value> or --team-mode=<value>; anything else throws.
Source
Thrown at src/cli/index.ts:709
}
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);
continue;
}
if (arg === "--enable-team" || arg === "--team") {
setValue("enabled", arg);
continue;
}
if (arg === "--team-mode") {
const next = args[index + 1];View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Use `enabled` or `disabled` exactly
- Prefer the shorthand flags --team/--no-team
Example fix
# before omx setup --team-mode on # after omx setup --team-mode enabled
Defensive patterns
Strategy: type-guard
Validate before calling
if (!['enabled','disabled'].includes(value)) throw new Error('invalid Team mode'); Type guard
const isSetupTeamMode = (v: string): v is 'enabled' | 'disabled' => v === 'enabled' || v === 'disabled';
Prevention
- Use enabled/disabled, not on/off/true/false
When it happens
Trigger: `--team-mode on`, `--team-mode enable`, wrong casing.
Common situations: Assuming boolean-ish synonyms like on/off/true/false are accepted.
Related errors
- Invalid setup install mode: ${next}. Expected one of: legacy
- Invalid setup MCP mode: ${next}. Expected one of: none, comp
- Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOP
- Conflicting setup Team mode flags: ${source} selects ${next}
- Missing setup Team mode value after --team-mode. Expected on
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/3afaa0eab7479bef.
Report an issue: GitHub.