stablyai/orca · error · Error

response.error.message

Error message

response.error.message

What it means

The ui.set RPC returned an RpcFailure (response.ok === false) while persisting the setup-hook trust approval. The ui.set method writes the trustedOrcaHooks map into the desktop's persistent UI state. A failure here means the host's settings store rejected the write or the transport broke.

Source

Thrown at mobile/src/tasks/setup-hook-trust.ts:50

  const approvedAt = args.approvedAt ?? Date.now()
  const existing = args.trust[args.repoId]
  const nextRepo = args.alwaysTrust
    ? { ...existing, all: { approvedAt } }
    : { ...existing, setup: { contentHash: args.contentHash, approvedAt } }
  return { ...args.trust, [args.repoId]: nextRepo }
}

export async function persistSetupHookTrustApproval(args: {
  client: RpcClient
  trust: PersistedTrustedOrcaHooks
  repoId: string
  contentHash: string
  alwaysTrust: boolean
}): Promise<PersistedTrustedOrcaHooks> {
  const next = trustedOrcaHooksWithSetupApproval(args)
  const response = await args.client.sendRequest('ui.set', { trustedOrcaHooks: next })
  if (!response.ok) {
    throw new Error(response.error.message)
  }
  return next
}

export function normalizeSetupHookTrust(
  setupTrust: SetupHookTrust | null | undefined
): SetupHookTrust | null {
  if (!setupTrust?.contentHash || !setupTrust.scriptContent) {
    return null
  }
  return setupTrust
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Catch and keep the in-memory trust approval (the next = trustedOrcaHooksWithSetupApproval) so the session still works, then retry the persist.
  2. If response.error.code === 'unauthorized', route to re-pair instead of retrying.
  3. Show a non-blocking toast 'Trust saved locally, will sync on reconnect' so the user is not blocked.
  4. Retry the ui.set call on the next 'connected' state change.

Example fix

// before
const response = await args.client.sendRequest('ui.set', { trustedOrcaHooks: next })
if (!response.ok) {
  throw new Error(response.error.message)
}
return next

// after — keep the session working, retry persist in the background
const response = await args.client.sendRequest('ui.set', { trustedOrcaHooks: next })
if (!response.ok && response.error.code !== 'unauthorized') {
  scheduleTrustPersistRetry(args.client, next)
}
return next
Defensive patterns

Strategy: retry

Validate before calling

if (client.getState() !== 'connected') {
  // Defer the persist until reconnect; keep in-memory trust
}

Type guard

function isRpcFailure(r: RpcResponse): r is RpcFailure {
  return !r.ok
}

Try / catch

try {
  await persistSetupHookTrustApproval({ client, trust, repoId, contentHash, alwaysTrust })
} catch (e) {
  // Keep the in-memory approval; retry on reconnect
  scheduleTrustPersistRetry(client, next)
}

Prevention

When it happens

Trigger: The desktop's settings store is locked or unwritable (permissions, disk full); the WebSocket dropped between the user tapping 'Trust' and the write landing; the host process is restarting; pairing revoked mid-call ('unauthorized').

Common situations: Host disk full or settings file locked by another process; relay disconnect during a settings write; user revoked pairing on the desktop while approving on mobile; host app in the middle of an update/restart.

Related errors


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