stablyai/orca · error · RuntimeClientError
invalid_argument
invalid_argument
Error message
missing ${key} What it means
stringParam (in desktop-script-provider-params.ts) is the top-level required-string guard used by snapshot and listWindows for the `app` field. It throws invalid_argument: missing ${key} when the value is absent, not a string, or empty. Every snapshot and window-list call must name a target app.
Source
Thrown at src/main/computer/desktop-script-provider-params.ts:6
import { RuntimeClientError } from './runtime-client-error'
export function stringParam(params: Record<string, unknown>, key: string): string {
const value = params[key]
if (typeof value !== 'string' || value.length === 0) {
throw new RuntimeClientError('invalid_argument', `missing ${key}`)
}
return value
}
export function optionalStringParam(
params: Record<string, unknown>,
key: string
): string | undefined {
const value = params[key]
return typeof value === 'string' ? value : undefined
}
export function optionalNumberParam(
params: Record<string, unknown>,
key: string
): number | undefined {
const value = params[key]
return typeof value === 'number' && Number.isFinite(value) ? value : undefinedView on GitHub (pinned to 1136503c6a)
Solutions
- Provide a non-empty app name (bundle id or process name).
- Use listApps() to discover valid app names before targeting.
- Validate the app field is a non-empty string at the call site.
Example fix
// before
await client.snapshot({ app: '' })
// after
await client.snapshot({ app: 'Safari' }) Defensive patterns
Strategy: validation
Validate before calling
if (typeof params.app !== 'string' || params.app.length === 0) {
throw new Error('app is required and must be a non-empty string')
} Type guard
const isAppName = (v: unknown): v is string => typeof v === 'string' && v.length > 0
Prevention
- Always pass a non-empty app name.
- Resolve app names via listApps() before targeting.
When it happens
Trigger: Calling snapshot({ app: '' }), snapshot({}), or listWindows({ app: 123 }).
Common situations: Caller omits app; passes an empty app name; passes a non-string app identifier.
Related errors
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/45cba8107a826c97.
Report an issue: GitHub.