stablyai/orca · error · RuntimeClientError

invalid_argument

invalid_argument

Error message

Pass exactly one of --me or --to-id

What it means

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.

Source

Thrown at src/cli/linear-request-builders.ts:41

import { RuntimeClientError } from './runtime-client'

const LINEAR_PRIORITY_VALUES = new Map([
  ['none', 0],
  ['urgent', 1],
  ['high', 2],
  ['medium', 3],
  ['low', 4]
])

export function buildAssigneeSetRequest(
  flags: Map<string, string | boolean>,
  cwd: string,
  remote: boolean
): LinearIssueTaskUpdateRequest {
  const me = flags.get('me') === true
  const toId = getOptionalStringFlag(flags, 'to-id')
  if (me === Boolean(toId)) {
    throw new RuntimeClientError('invalid_argument', 'Pass exactly one of --me or --to-id')
  }
  return {
    ...buildWriteTargetRequest(flags, cwd, remote),
    operation: 'assignee',
    ...(me ? { assigneeMe: true } : { assigneeId: toId })
  }
}

export function getLinearListFilter(
  flags: Map<string, string | boolean>
): LinearIssueListRequest['filter'] {
  const filter = getOptionalStringFlag(flags, 'filter') ?? 'assigned'
  if (['assigned', 'created', 'all', 'completed', 'open'].includes(filter)) {
    return filter as LinearIssueListRequest['filter']
  }
  throw new RuntimeClientError(
    'invalid_argument',
    '--filter must be assigned, created, all, completed, or open'

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Use --me to assign to yourself.
  2. Use --to-id <userId> to assign to a specific Linear user.
  3. Ensure exactly one of the two flags is present; remove the other.

Example fix

# before
orca linear assign --me --to-id user_123
# after
orca linear assign --to-id user_123
Defensive patterns

Strategy: validation

Validate before calling

// Enforce exactly-one-of before building the assignee request:
const me = flags.get('me') === true;
const toId = flags.get('to-id');
const hasToId = typeof toId === 'string' && toId.length > 0;
if (me === hasToId) {
  throw new Error('Pass exactly one of --me or --to-id');
}

Type guard

function hasExactlyOneAssignee(flags: Map<string, string | boolean>): boolean {
  const me = flags.get('me') === true;
  const toId = flags.get('to-id');
  const hasToId = typeof toId === 'string' && toId.length > 0;
  return me !== hasToId;
}

Try / catch

try {
  const request = buildAssigneeSetRequest(flags, cwd, remote);
} catch (e) {
  if (e instanceof RuntimeClientError) {
    console.error(e.message);
    process.exit(1);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Script that conditionally includes both flags, user assuming --me is the default when --to-id is absent, flag alias collision.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/a4a353dd1fa4b403. Report an issue: GitHub.