stablyai/orca · error · Error

direct pairing upgrade was not authoritatively committed

Error message

direct pairing upgrade was not authoritatively committed

What it means

Thrown by `publishCommitted` in the direct-upgrade path when `endpoints.installStatus?.state !== 'committed'` or `endpoints.relay` is missing. This is the final authoritative check before writing the credential bundle and publishing the relay host — it guarantees the bundle and host profile are never advertised without a matching committed install.

Source

Thrown at mobile/src/transport/mobile-relay-direct-upgrade.ts:103

  }
  const installed = DeviceCredentialInstalledSchema.parse(requireSuccess(provisionResponse))
  assertDirectInstall(journal, installed)
  const reconciled = await getEndpoints(args.client, journal.reqId)
  if (reconciled === 'method-not-found') {
    throw new Error('relay endpoint reconciliation became unavailable')
  }
  assertCommitted(reconciled, installed)
  return publishCommitted(args.host, journal, reconciled, dependencies)
}

async function publishCommitted(
  host: HostProfile,
  journal: MobileRelayDirectUpgradeJournal,
  endpoints: PairingGetEndpointsResult,
  dependencies: Dependencies
): Promise<MobileRelayDirectUpgradeResult> {
  if (endpoints.installStatus?.state !== 'committed' || !endpoints.relay) {
    throw new Error('direct pairing upgrade was not authoritatively committed')
  }
  const installed = endpoints.installStatus.result
  assertDirectInstall(journal, installed)
  const bundle = MobileRelayCredentialBundleSchema.parse({
    v: 1,
    hostId: host.id,
    deviceToken: host.deviceToken,
    current: {
      token: journal.pendingResumeToken,
      hash: journal.pendingResumeTokenHash,
      version: installed.currentVersion,
      expiresAt: installed.resumeExpiresAt
    }
  })
  // Why: the overlay must never advertise relay without its matching credential.
  await dependencies.writeBundle(bundle)
  let updatedHost: HostProfile
  try {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Re-fetch endpoints and retry publish once if the state regressed.
  2. Never call `publishCommitted` except from the committed branch of `upgradeDirectMobileRelay`.
  3. If persistent, treat as server inconsistency and abort the upgrade (preserve the journal).

Example fix

// before
return publishCommitted(host, journal, endpoints, dependencies) // throws

// after
if (endpoints.installStatus?.state !== 'committed' || !endpoints.relay) {
  endpoints = await getEndpoints(client, journal.reqId) // re-check
}
return publishCommitted(host, journal, endpoints, dependencies)
Defensive patterns

Strategy: validation

Validate before calling

function isCommittedWithRelay(e: PairingGetEndpointsResult): boolean {
  return e.installStatus?.state === 'committed' && !!e.relay
}
if (!isCommittedWithRelay(endpoints)) { endpoints = await getEndpoints(client, journal.reqId) }

Type guard

function isPublishable(e: PairingGetEndpointsResult): boolean { return e.installStatus?.state === 'committed' && !!e.relay }

Try / catch

try { return await upgradeDirectMobileRelay({ client, host }) } catch (e) { if (e.message === 'direct pairing upgrade was not authoritatively committed') { /* preserve journal, abort */ abortUpgradePreserveJournal(hostId); throw e } throw e }

Prevention

When it happens

Trigger: `assertCommitted` passed but `publishCommitted` was called with a different endpoints object whose state regressed; the committed install lost its `relay` field between calls; a code path that reaches `publishCommitted` without the committed invariant.

Common situations: Refactor that reorders the committed check and publish; server-side state regression between reconciliation and publish; race that mutates the endpoints object.

Related errors


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