paperclipai/paperclip · warning · Error

Choose either --rpc-only or --wham-only, not both.

Error message

Choose either --rpc-only or --wham-only, not both.

What it means

Thrown by the Codex quota-probe CLI main() when both --rpc-only and --wham-only flags are passed. The two flags restrict the probe to mutually exclusive quota sources (the RPC quota path vs. the WHAM/token-based path), so passing both is contradictory and the CLI refuses rather than arbitrarily choosing one.

Source

Thrown at packages/adapters/codex-local/src/cli/quota-probe.ts:38

    json: argv.includes("--json"),
    rpcOnly: argv.includes("--rpc-only"),
    whamOnly: argv.includes("--wham-only"),
  };
}

function stringifyError(error: unknown): string {
  return error instanceof Error ? error.message : String(error);
}

function quotaErrorFamilyJson(error: unknown): Record<string, string> {
  const errorFamily = readCodexQuotaErrorFamily(error);
  return errorFamily ? { errorFamily } : {};
}

async function main() {
  const args = parseArgs(process.argv.slice(2));
  if (args.rpcOnly && args.whamOnly) {
    throw new Error("Choose either --rpc-only or --wham-only, not both.");
  }

  const auth = await readCodexAuthInfo();
  const token = await readCodexToken();

  const result: Record<string, unknown> = {
    timestamp: new Date().toISOString(),
    auth,
    tokenAvailable: token != null,
  };

  if (!args.whamOnly) {
    try {
      result.rpc = {
        ok: true,
        ...(await fetchCodexRpcQuota()),
      };
    } catch (error) {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Pass at most one of --rpc-only or --wham-only; omitting both runs both quota sources (default).
  2. Audit the calling script for logic that can set both flags at once.
  3. Use --json and filter the section you want client-side instead of restricting in-process.

Example fix

// before
node quota-probe.js --rpc-only --wham-only
// after
node quota-probe.js --rpc-only
Defensive patterns

Strategy: validation

Validate before calling

if (args.rpcOnly && args.whamOnly) {
  console.error("Pass at most one of --rpc-only / --wham-only");
  process.exit(2);
}

Prevention

When it happens

Trigger: Invoking the Codex quota-probe binary with both flags: `node quota-probe.js --rpc-only --wham-only`. parseArgs sets both booleans true and main() throws before reading auth/quota.

Common situations: A wrapper script that conditionally appends both flags; copy-pasting flags from two examples; a job template that listed both options defensively.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/f1113ebbc0e82cb0. Report an issue: GitHub.