stablyai/orca · error · RuntimeClientError

invalid_argument

invalid_argument

Error message

Window targeting accepts either --window-id or --window-index, not both

What it means

Thrown by validateExclusiveWindowTarget when both --window-id and --window-index are supplied to a computer-action command. These are two ways to identify the same OS window (opaque id vs positional index); passing both is ambiguous, so the validator rejects the combination before the action is dispatched.

Source

Thrown at src/cli/handlers/computer-action-flag-validation.ts:8

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

export function validateExclusiveWindowTarget(
  windowId: number | undefined,
  windowIndex: number | undefined
): void {
  if (windowId !== undefined && windowIndex !== undefined) {
    throw new RuntimeClientError(
      'invalid_argument',
      'Window targeting accepts either --window-id or --window-index, not both'
    )
  }
}

export function validateElementOrCoordinates(
  actionName: 'Click' | 'Scroll',
  elementIndex: number | undefined,
  x: number | undefined,
  y: number | undefined
): void {
  const hasElement = elementIndex !== undefined
  const hasX = x !== undefined
  const hasY = y !== undefined
  if (!hasElement && !(hasX && hasY)) {
    throw new RuntimeClientError(
      'invalid_argument',

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Keep exactly one window-targeting flag: --window-id (stable id) OR --window-index (positional).
  2. If you only know the window's position, drop --window-id; if you have its id, drop --window-index.
  3. Make wrapper code resolve a single window reference and emit only the corresponding flag.

Example fix

// before
orca computer click --window-id 42 --window-index 0 --element-index 3
// after
orca computer click --window-id 42 --element-index 3
Defensive patterns

Strategy: validation

Validate before calling

function assertSingleWindowTarget(windowId: number | undefined, windowIndex: number | undefined): void {
  if (windowId !== undefined && windowIndex !== undefined) {
    throw new Error('pass --window-id OR --window-index, not both')
  }
}

Prevention

When it happens

Trigger: Any computer-action call (click, scroll, screenshot, etc.) routed through validateExclusiveWindowTarget with both `windowId !== undefined` and `windowIndex !== undefined`, e.g. `--window-id 42 --window-index 0`.

Common situations: Layered wrapper code that sets --window-id from one source and --window-index from another and never reconciles them. Copy-pasting flags from two examples.

Related errors


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