stablyai/orca · error
${response.error.code}: ${response.error.message}
Error message
${response.error.code}: ${response.error.message} What it means
The generic RPC-failure throw in requireSuccess (line 285-290). Called for provisionRelay and pairing.getEndpoints results in runPairing: if response.ok is false and the error is not method_not_found (handled separately by isMethodNotFound), the raw JSON-RPC error code and message are concatenated and rethrown. This is the catch-all that surfaces any server-returned RPC failure — auth errors, invalid params, internal errors — preserving the desktop's own error vocabulary.
Source
Thrown at mobile/src/transport/pre-profile-pairing-coordinator.ts:287
endpoints: [
{ id: 'direct-primary', kind: 'lan', url: host.endpoint },
{ id: 'relay-primary', kind: 'relay', url: relayWebSocketUrl(relay) }
],
relayHostId: relay.relayHostId,
relay
}
}
function relayWebSocketUrl(relay: MobileRelayEndpoint): string {
const url = new URL(relay.cellUrl)
url.protocol = 'wss:'
url.pathname = `/v1/connect/${encodeURIComponent(relay.relayHostId)}`
return url.toString()
}
function requireSuccess(response: RpcResponse): unknown {
if (!response.ok) {
throw new Error(`${response.error.code}: ${response.error.message}`)
}
return response.result
}
function isMethodNotFound(response: RpcResponse): boolean {
return !response.ok && response.error.code === 'method_not_found'
}
function assertCommittedInstall(
status:
| { state: 'not-found' }
| { state: 'committed'; result: DeviceCredentialInstalled }
| undefined,
installed: DeviceCredentialInstalled
): void {
if (
!status ||
status.state !== 'committed' ||View on GitHub (pinned to 1136503c6a)
Solutions
- Parse the '<code>: <message>' string: the code determines the fix — 'invalid_params' means check installReqId/newResumeTokenHash in the journal; 'auth_error' means re-pair; 'internal_error' means inspect desktop logs.
- Clear the mobile relay pairing journal (clearMobileRelayPairingJournal) and re-initiate pairing to get a fresh installReqId.
- On the desktop, check logs for the matching reqId to see why the RPC rejected.
- If the code is relay-specific, retry over the direct path by ensuring the direct candidate wins the race.
Defensive patterns
Strategy: try-catch
Type guard
interface RpcFailureLike { code: string; message: string }
function parseRpcFailureMessage(error: unknown): RpcFailureLike | null {
if (!(error instanceof Error)) return null
const match = /^(\w+): (.+)$/.exec(error.message)
return match ? { code: match[1], message: match[2] } : null
} Try / catch
try {
await winner.client.sendRequest('pairing.provisionRelay', params)
} catch (error) {
const failure = parseRpcFailureMessage(error)
if (failure) {
switch (failure.code) {
case 'invalid_params': /* check installReqId/resumeTokenHash */ break
case 'auth_error': /* re-pair */ break
case 'internal_error': /* inspect desktop logs */ break
}
}
throw error
} Prevention
- Inspect the '<code>: <message>' format to route recovery by error code.
- Clear the mobile relay pairing journal and re-pair to get a fresh installReqId when codes suggest state corruption.
- Correlate the reqId in desktop logs when this surfaces in production.
When it happens
Trigger: winner.client.sendRequest returned an RpcFailure (ok:false) with any error.code other than 'method_not_found'. Common codes: 'invalid_params' (wrong installReqId, mismatched newResumeTokenHash), 'internal_error' (desktop crashed during install), 'auth_error' (deviceToken rejected), or relay-propagated errors. The message format is '<code>: <message>'.
Common situations: Pairing against a desktop whose install state is inconsistent (installReqId unknown → invalid_params), a desktop that lost its credential store between provisionRelay and getEndpoints, or a relay that forwarded a 5xx-derived RPC error. Also surfaces when the resume token hash in the journal doesn't match what the desktop expects.
Related errors
- relay pairing client closed
- relay pairing RPC unavailable after relay path authenticatio
- desktop returned no relay endpoint after credential install
- relay credential install was not authoritatively reconciled
- ${commandLabel} ${args.join(' ')} failed to start: ${String(
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/0cc9288784c4a4a4.
Report an issue: GitHub.