{"record":{"id":"a4a353dd1fa4b403","repo":"stablyai/orca","slug":"invalid-argument-a4a353","errorCode":"invalid_argument","errorMessage":"Pass exactly one of --me or --to-id","messagePattern":"Pass exactly one of --me or --to-id","errorType":"validation","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/linear-request-builders.ts","lineNumber":41,"sourceCode":"import { RuntimeClientError } from './runtime-client'\n\nconst LINEAR_PRIORITY_VALUES = new Map([\n  ['none', 0],\n  ['urgent', 1],\n  ['high', 2],\n  ['medium', 3],\n  ['low', 4]\n])\n\nexport function buildAssigneeSetRequest(\n  flags: Map<string, string | boolean>,\n  cwd: string,\n  remote: boolean\n): LinearIssueTaskUpdateRequest {\n  const me = flags.get('me') === true\n  const toId = getOptionalStringFlag(flags, 'to-id')\n  if (me === Boolean(toId)) {\n    throw new RuntimeClientError('invalid_argument', 'Pass exactly one of --me or --to-id')\n  }\n  return {\n    ...buildWriteTargetRequest(flags, cwd, remote),\n    operation: 'assignee',\n    ...(me ? { assigneeMe: true } : { assigneeId: toId })\n  }\n}\n\nexport function getLinearListFilter(\n  flags: Map<string, string | boolean>\n): LinearIssueListRequest['filter'] {\n  const filter = getOptionalStringFlag(flags, 'filter') ?? 'assigned'\n  if (['assigned', 'created', 'all', 'completed', 'open'].includes(filter)) {\n    return filter as LinearIssueListRequest['filter']\n  }\n  throw new RuntimeClientError(\n    'invalid_argument',\n    '--filter must be assigned, created, all, completed, or open'","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/linear-request-builders.ts#L23-L59","documentation":"Thrown by buildAssigneeSetRequest when the assignee target is ambiguous: the XOR check 'me === Boolean(toId)' fails if both --me and --to-id are set, or if neither is set. Exactly one must be provided to know who to assign the Linear issue to.","triggerScenarios":"Running a Linear assignee command with both '--me --to-id user_123', or with neither flag. Boolean(toId) is truthy for any non-empty string, falsy for undefined/empty.","commonSituations":"Script that conditionally includes both flags, user assuming --me is the default when --to-id is absent, flag alias collision.","solutions":["Use --me to assign to yourself.","Use --to-id <userId> to assign to a specific Linear user.","Ensure exactly one of the two flags is present; remove the other."],"exampleFix":"# before\norca linear assign --me --to-id user_123\n# after\norca linear assign --to-id user_123","handlingStrategy":"validation","validationCode":"// Enforce exactly-one-of before building the assignee request:\nconst me = flags.get('me') === true;\nconst toId = flags.get('to-id');\nconst hasToId = typeof toId === 'string' && toId.length > 0;\nif (me === hasToId) {\n  throw new Error('Pass exactly one of --me or --to-id');\n}","typeGuard":"function hasExactlyOneAssignee(flags: Map<string, string | boolean>): boolean {\n  const me = flags.get('me') === true;\n  const toId = flags.get('to-id');\n  const hasToId = typeof toId === 'string' && toId.length > 0;\n  return me !== hasToId;\n}","tryCatchPattern":"try {\n  const request = buildAssigneeSetRequest(flags, cwd, remote);\n} catch (e) {\n  if (e instanceof RuntimeClientError) {\n    console.error(e.message);\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Decide assignee target before building the command line.","Do not include --me as a default alongside --to-id.","In scripts, use an if/else to emit exactly one flag."],"tags":["cli","linear","flag-validation","mutually-exclusive"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}