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

Setup AGENTS merge policy flags do not accept values: ${arg}

Error message

Setup AGENTS merge policy flags do not accept values: ${arg}

What it means

The setup AGENTS merge policy flags (--merge-agents, --no-merge-agents, --clear-merge-agents-policy) are boolean switches and do not accept values. Passing them with an inline value via `=` (e.g. --merge-agents=true) throws this error. Use the bare flag or the separate --merge-agents-policy flag to set a policy value.

Source

Thrown at src/cli/index.ts:558

    const arg = args[index];
    if (arg === "--merge-agents" || arg === "--no-merge-agents" || arg === "--clear-merge-agents-policy") {
      const next = args[index + 1];
      if (next && !next.startsWith("--")) {
        throw new Error(`Setup AGENTS merge policy flags do not accept values: ${arg} ${next}`);
      }
      if (arg === "--merge-agents") {
        setPolicy({ kind: "set", value: true }, arg);
      } else if (arg === "--no-merge-agents") {
        setPolicy({ kind: "set", value: false }, arg);
      } else {
        setPolicy({ kind: "clear" }, arg);
      }
    } else if (
      arg.startsWith("--merge-agents=") ||
      arg.startsWith("--no-merge-agents=") ||
      arg.startsWith("--clear-merge-agents-policy=")
    ) {
      throw new Error(`Setup AGENTS merge policy flags do not accept values: ${arg}`);
    }
  }
  return policy;
}

export function resolveSetupMergeAgentsArg(args: string[]): boolean | undefined {
  const policy = resolveSetupAgentsMergePolicyArg(args);
  return policy?.kind === "set" ? policy.value : undefined;
}

export function resolveSetupInstallModeArg(args: string[]): SetupInstallMode | undefined {
  let value: SetupInstallMode | undefined;
  const setValue = (next: SetupInstallMode, source: string): void => {
    if (value && value !== next) {
      throw new Error(
        `Conflicting setup install mode flags: ${source} selects ${next}, but another flag already selected ${value}`,
      );
    }

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Remove the `=value` suffix and use the bare flag (e.g. `--merge-agents`)
  2. To specify a policy value, use the dedicated --merge-agents-policy flag instead
  3. Check shell scripts that quote/append values onto flag names

Example fix

# before
omx setup --merge-agents=append
# after
omx setup --merge-agents --merge-agents-policy append
Defensive patterns

Strategy: validation

Validate before calling

const bad = /^(--merge-agents|--no-merge-agents|--clear-merge-agents-policy)=/.test(arg);

Prevention

When it happens

Trigger: Running a setup command with `--merge-agents=<value>`, `--no-merge-agents=<value>`, or `--clear-merge-agents-policy=<value>`.

Common situations: Users accustomed to `--flag=value` CLI syntax apply it to boolean toggles; scripting generated args with template interpolation producing `--merge-agents=`.

Related errors


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