stablyai/orca · error · RuntimeClientError

linear_issue_required

linear_issue_required

Error message

Pass a Linear issue id or --current

What it means

Thrown by buildWriteTargetRequest when a Linear write operation is given NEITHER an issue `<id>` NOR the `--current` flag. A write must target exactly one issue; with no target the builder cannot proceed. It fires after rejectAllWorkspaceForWrite and before constructing the request payload.

Source

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

    include: includes,
    depth: clampLinearIssueDepth(requestedDepth),
    context: buildLinearCurrentContext(cwd, remote)
  }
}

export function buildWriteTargetRequest(
  flags: Map<string, string | boolean>,
  cwd: string,
  remote: boolean
): LinearWriteTargetRequest {
  rejectAllWorkspaceForWrite(flags)
  const input = getOptionalStringFlag(flags, 'id')
  const current = flags.get('current') === true
  if (input && current) {
    throw new RuntimeClientError('invalid_argument', 'Pass either <id> or --current, not both')
  }
  if (!input && !current) {
    throw new RuntimeClientError('linear_issue_required', 'Pass a Linear issue id or --current')
  }
  return {
    input,
    current,
    workspaceId: getOptionalStringFlag(flags, 'workspace'),
    context: buildLinearCurrentContext(cwd, remote)
  }
}

export function buildLinearCurrentContext(
  cwd: string,
  remote: boolean
): LinearIssueRequest['context'] {
  return {
    remote,
    ...(remote ? {} : { cwd }),
    ...(process.env.ORCA_WORKTREE_ID ? { worktreeId: process.env.ORCA_WORKTREE_ID } : {}),
    ...(process.env.ORCA_TERMINAL_HANDLE

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Pass an explicit issue id: `linear comment LIN-123 --body "..."`.
  2. Or run from inside a branch whose name/description is linked to a Linear issue and add `--current`.
  3. If scripting, verify the id is non-empty before invoking: `if [ -n "$ID" ]; then linear comment "$ID" ...; fi`.

Example fix

// before
linear comment --body "fix shipped"
// after
linear comment LIN-123 --body "fix shipped"
Defensive patterns

Strategy: validation

Validate before calling

const input = flags.get('id')
const current = flags.get('current') === true
if (!input && !current) {
  throw new Error('Linear write requires an issue id or --current')
}

Type guard

function hasWriteTarget(flags: Map<string, string | boolean>): boolean {
  return Boolean(flags.get('id')) || flags.get('current') === true
}

Prevention

When it happens

Trigger: Running a write subcommand with no positional id and no `--current`, e.g. `linear comment --body "..."`. Any call into buildWriteTargetRequest where both `input` is falsy and `flags.get('current') !== true`.

Common situations: Running a write command outside a git worktree/branch linked to a Linear issue (so `--current` resolves nothing) and forgetting the id. Scripts that conditionally pass an id that ends up empty. CI runners with no Linear branch context.

Related errors


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