{"record":{"id":"f1113ebbc0e82cb0","repo":"paperclipai/paperclip","slug":"choose-either-rpc-only-or-wham-only-not-both","errorCode":null,"errorMessage":"Choose either --rpc-only or --wham-only, not both.","messagePattern":"Choose either --rpc-only or --wham-only, not both\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/adapters/codex-local/src/cli/quota-probe.ts","lineNumber":38,"sourceCode":"    json: argv.includes(\"--json\"),\n    rpcOnly: argv.includes(\"--rpc-only\"),\n    whamOnly: argv.includes(\"--wham-only\"),\n  };\n}\n\nfunction stringifyError(error: unknown): string {\n  return error instanceof Error ? error.message : String(error);\n}\n\nfunction quotaErrorFamilyJson(error: unknown): Record<string, string> {\n  const errorFamily = readCodexQuotaErrorFamily(error);\n  return errorFamily ? { errorFamily } : {};\n}\n\nasync function main() {\n  const args = parseArgs(process.argv.slice(2));\n  if (args.rpcOnly && args.whamOnly) {\n    throw new Error(\"Choose either --rpc-only or --wham-only, not both.\");\n  }\n\n  const auth = await readCodexAuthInfo();\n  const token = await readCodexToken();\n\n  const result: Record<string, unknown> = {\n    timestamp: new Date().toISOString(),\n    auth,\n    tokenAvailable: token != null,\n  };\n\n  if (!args.whamOnly) {\n    try {\n      result.rpc = {\n        ok: true,\n        ...(await fetchCodexRpcQuota()),\n      };\n    } catch (error) {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/adapters/codex-local/src/cli/quota-probe.ts#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"A wrapper script that conditionally appends both flags; copy-pasting flags from two examples; a job template that listed both options defensively.","solutions":["Pass at most one of --rpc-only or --wham-only; omitting both runs both quota sources (default).","Audit the calling script for logic that can set both flags at once.","Use --json and filter the section you want client-side instead of restricting in-process."],"exampleFix":"// before\nnode quota-probe.js --rpc-only --wham-only\n// after\nnode quota-probe.js --rpc-only","handlingStrategy":"validation","validationCode":"if (args.rpcOnly && args.whamOnly) {\n  console.error(\"Pass at most one of --rpc-only / --wham-only\");\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a single --source rpc|wham|both selector instead of two mutually-exclusive booleans.","Validate flag exclusivity in wrapper scripts.","Document the mutual exclusion at the flag definitions."],"tags":["cli","arguments","quota","codex","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}