stablyai/orca · error · RuntimeClientError

runtime_error

runtime_error

Error message

Failed to create browser profile (label=${label}, scope=${scope})

What it means

Thrown by the `tab profile create` handler when browser.profileCreate succeeds at the transport level but returns `result.result.profile === null`. Because the client already validated the scope, a null profile indicates a server-side rejection (registry refused the combination) that must not be reported as success. Note the code is runtime_error, not invalid_argument — this is a server-side failure surfaced upward, distinct from the client flag errors.

Source

Thrown at src/cli/handlers/browser-profile.ts:48

export const BROWSER_PROFILE_HANDLERS: Record<string, CommandHandler> = {
  'tab profile list': async ({ client, json }) => {
    const result = await client.call<BrowserProfileListResult>('browser.profileList')
    printResult(result, json, formatBrowserProfileList)
  },
  'tab profile create': async ({ flags, client, json }) => {
    const label = getRequiredStringFlag(flags, 'label')
    const scope = parseScopeFlag(flags)
    const result = await client.call<BrowserProfileCreateResult>('browser.profileCreate', {
      label,
      scope,
      ...(flags.get('no-ua-spoof') === true ? { userAgentMode: 'native' } : {})
    })
    if (result.result.profile === null) {
      // Why: registry refuses non-isolated/imported scopes; we already validated
      // the scope client-side, so a null here means a server-side rejection we
      // shouldn't silently report as success.
      throw new RuntimeClientError(
        'runtime_error',
        `Failed to create browser profile (label=${label}, scope=${scope})`
      )
    }
    printResult(
      result,
      json,
      (value) =>
        `Created profile ${value.profile?.id ?? 'unknown'} (${value.profile?.label ?? label})`
    )
  },
  'tab profile delete': async ({ flags, client, json }) => {
    const profileId = getRequiredStringFlag(flags, 'profile')
    const result = await client.call<BrowserProfileDeleteResult>('browser.profileDelete', {
      profileId
    })
    printResult(result, json, (value) =>
      value.deleted

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Retry with --scope isolated (the most permissive scope) to confirm the server accepts profile creation at all.
  2. Check the server/host logs for the registry rejection reason behind the null profile.
  3. Verify client and server versions are compatible for the profileCreate contract and that the 'imported' scope is enabled on the host if you used it.
  4. If the rejection persists, report the label/scope pair to the host operator rather than treating it as a client flag fix.
Defensive patterns

Strategy: try-catch

Type guard

function isCreatedProfile(r: BrowserProfileCreateResult | undefined): r is { profile: { id: string; label: string } } {
  return !!r && r.profile !== null && typeof r.profile?.id === 'string'
}

Try / catch

try {
  const result = await client.call('browser.profileCreate', { label, scope, ... })
  if (result.result.profile === null) {
    // server rejected; surface a actionable message and fall back to isolated scope
    throw new Error(`server refused profile (label=${label}, scope=${scope}); retry with --scope isolated`)
  }
} catch (err) {
  if (String(err).includes('Failed to create browser profile')) {
    // retry once with isolated scope, then surface host logs
  }
  throw err
}

Prevention

When it happens

Trigger: Calling browser.profileCreate with a label/scope combination the server-side profile registry rejects (e.g. an imported-profile constraint the server enforces that the client does not pre-check, or a registry capacity/permission issue), so the RPC returns a non-throwing response with profile: null.

Common situations: Server build newer/older than the client with a different accepted scope set; the 'imported' scope disabled by policy/config on the host; a transient registry lock or permission issue on the profile store. The existing inline comment explicitly flags this as a server-side rejection path.

Related errors


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