{"record":{"id":"6ce89caf4b79c576","repo":"stablyai/orca","slug":"invalid-argument-6ce89c","errorCode":"invalid_argument","errorMessage":"Use either --pairing-code or --environment, not both.","messagePattern":"Use either --pairing-code or --environment, not both\\.","errorType":"validation","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/runtime/client.ts","lineNumber":277,"sourceCode":"      orchestrationRequestId: requestId\n    }\n  )\n}\n\nfunction throwDesktopActivationBlocked(): never {\n  throw new RuntimeClientError(\n    'desktop_activation_blocked',\n    'Orca is running headlessly, but it cannot open a desktop window safely because the persistent terminal provider is unavailable. Quit Orca normally and start the app again; do not use open -n.'\n  )\n}\n\nfunction resolveRemotePairing(\n  userDataPath: string,\n  pairingCode: string | null,\n  environmentSelector: string | null\n): PairingOffer | null {\n  if (pairingCode && environmentSelector) {\n    throw new RuntimeClientError(\n      'invalid_argument',\n      'Use either --pairing-code or --environment, not both.'\n    )\n  }\n  if (environmentSelector) {\n    return resolveEnvironmentPairingOffer(userDataPath, environmentSelector)\n  }\n  if (!pairingCode) {\n    return null\n  }\n  const pairing = parsePairingCode(pairingCode)\n  if (!pairing) {\n    throw new RuntimeClientError(\n      'invalid_argument',\n      'Invalid remote pairing code. Expected an orca://pair?... URL or bare pairing payload.'\n    )\n  }\n  return pairing","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/runtime/client.ts#L259-L295","documentation":"Thrown by resolveRemotePairing when BOTH `--pairing-code` and `--environment` are supplied. Remote pairing resolves a target via exactly one channel: an explicit pairing code (orca://pair URL or bare payload) or a named environment selector. Providing both is ambiguous and the builder refuses to pick.","triggerScenarios":"Invoking a remote-pairing command with both flags set, e.g. `--pairing-code orca://pair?... --environment prod`. Any call into resolveRemotePairing where both pairingCode and environmentSelector are non-null.","commonSituations":"Scripts that set a default `--environment` and then pass `--pairing-code` for one run. Migrating from environment-selector-based to code-based pairing and forgetting to clear the old flag. Config files that populate both.","solutions":["Keep `--pairing-code <code>` and remove `--environment` for direct pairing.","Or keep `--environment <name>` and remove `--pairing-code` to pair via the named environment.","Audit config files and aliases that may inject both flags."],"exampleFix":"// before\norca remote --pairing-code orca://pair?c=abc --environment prod\n// after\norca remote --pairing-code orca://pair?c=abc","handlingStrategy":"validation","validationCode":"if (pairingCode && environmentSelector) {\n  throw new Error('Pass either --pairing-code or --environment, not both')\n}","typeGuard":"function hasSinglePairingChannel(code: string | null, env: string | null): boolean {\n  return Boolean(code) !== Boolean(env)\n}","tryCatchPattern":null,"preventionTips":["Choose one pairing channel per invocation.","Do not default both flags in config files."],"tags":["cli","remote","pairing","flag-validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}