stablyai/orca · error · RuntimeClientError

invalid_argument

invalid_argument

Error message

Choose either one parent selector or --no-parent.

What it means

Thrown by assertCreateParentFlagsCompatible when both `--parent-worktree` (any value) and `--no-parent` (boolean true) are supplied to a worktree-create command. The two are mutually exclusive: one names an explicit parent, the other declares no parent at all. The message is shared via the CREATE_PARENT_CONFLICT_MESSAGE constant.

Source

Thrown at src/cli/handlers/worktree-create-parent-selector.ts:15

import { isWorkspaceKey } from '../../shared/workspace-scope'
import { getOptionalStringFlag } from '../flags'
import { RuntimeClientError, type RuntimeClient } from '../runtime-client'
import { getOptionalWorktreeSelector } from '../selectors'

export type CreateParentSelector = {
  parentWorktree?: string
  parentWorkspace?: string
}

const CREATE_PARENT_CONFLICT_MESSAGE = 'Choose either one parent selector or --no-parent.'

export function assertCreateParentFlagsCompatible(flags: Map<string, string | boolean>): void {
  if (flags.has('parent-worktree') && flags.get('no-parent') === true) {
    throw new RuntimeClientError('invalid_argument', CREATE_PARENT_CONFLICT_MESSAGE)
  }
  const parentWorktree = flags.get('parent-worktree')
  if (
    flags.has('parent-worktree') &&
    (typeof parentWorktree !== 'string' || parentWorktree === '')
  ) {
    throw new RuntimeClientError('invalid_argument', 'Missing required --parent-worktree')
  }
}

function getWorkspaceKeyParentSelector(selector: string): string | undefined {
  const rawSelector = selector.startsWith('id:') ? selector.slice('id:'.length) : selector
  return isWorkspaceKey(rawSelector) ? rawSelector : undefined
}

export async function resolveCreateParentSelector(
  flags: Map<string, string | boolean>,
  cwd: string,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Choose one: either `--parent-worktree <selector>` for an explicit parent, or `--no-parent` for none.
  2. In wrappers, drop `--no-parent` whenever `--parent-worktree` is set, and vice-versa.
  3. If neither is given, Orca applies its default parent resolution.

Example fix

// before
orca worktree create --parent-worktree main --no-parent
// after
orca worktree create --parent-worktree main
// or
orca worktree create --no-parent
Defensive patterns

Strategy: validation

Validate before calling

if (flags.has('parent-worktree') && flags.get('no-parent') === true) {
  // reject: --parent-worktree and --no-parent are mutually exclusive
}

Type guard

function createParentFlagsCompatible(flags: Map<string, string | boolean>): boolean {
  return !(flags.has('parent-worktree') && flags.get('no-parent') === true)
}

Try / catch

try { await worktreeCreate(flags) }
catch (e) {
  if (e instanceof RuntimeClientError && e.code === 'invalid_argument' && e.message === 'Choose either one parent selector or --no-parent.') {
    // drop one of the two based on intent, then retry
  } else throw e
}

Prevention

When it happens

Trigger: Running `orca worktree create --parent-worktree <x> --no-parent`, or a wrapper that defaults `--no-parent` on while still forwarding a parent selector.

Common situations: Script that sets `--no-parent` as a default and also passes through user-provided `--parent-worktree`; UI that exposes both controls and submits both; copy-paste combining two examples.

Related errors


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