tinyhumansai/openhuman · error

oauthAuthReadinessUserMessage(quick.reason)

Error message

oauthAuthReadinessUserMessage(quick.reason)

What it means

Thrown by prepareOAuthLoginLaunch() after an 8-second preflight waiting for the local OpenHuman core to become ready before opening the system browser for OAuth. waitForOAuthAuthReadiness() polls core RPC reachability and core-mode selection; if either fails within the budget it returns {ready:false, reason}, and this line converts the reason into a human-readable message via oauthAuthReadinessUserMessage(). The reason is either 'core_mode_unset' (user never finished setup mode selection) or 'core_unreachable' (RPC ping failed after the deadline).

Source

Thrown at app/src/components/oauth/oauthAuthReadiness.ts:165

        'OpenHuman could not reach its local runtime. Quit and reopen the app, ' +
        'then try signing in again.'
      );
    }
    default:
      return 'Sign-in is still starting up. Wait a few seconds and try again.';
  }
}

/**
 * Lightweight preflight before opening the system browser for OAuth.
 * Blocks browser launch when the local auth runtime is not ready yet.
 * `waitForOAuthAuthReadiness()` starts the local core when needed.
 */
export async function prepareOAuthLoginLaunch(): Promise<void> {
  const quick = await waitForOAuthAuthReadiness(8_000);
  if (!quick.ready) {
    warnLog(`${logPrefix} pre-launch readiness`, quick);
    throw new Error(oauthAuthReadinessUserMessage(quick.reason));
  }
}

View on GitHub (pinned to 7491200858)

Solutions

  1. If the message mentions choosing how OpenHuman runs: finish the setup/onboarding screen (select local or cloud mode) and retry sign-in.
  2. If local runtime unreachable: fully quit the app (verify no openhuman-core process lingers in Task Manager/Activity Monitor) and reopen, then retry.
  3. If cloud runtime unreachable: check Settings for the correct RPC URL and token, re-enter them, and retry.
  4. Give the core more than 8s on slow machines — retry the sign-in action after a few seconds; if it persists, inspect core logs for startup crashes.
  5. Developers: call waitForOAuthAuthReadiness() with a larger maxWaitMs or catch this error and surface a retry UI instead of a dead-end.

Example fix

// before
await prepareOAuthLoginLaunch(); // throws after fixed 8s budget
openSystemBrowser(authUrl);

// after
const ready = await waitForOAuthAuthReadiness(20_000);
if (!ready.ready) {
  showRetryableNotice(oauthAuthReadinessUserMessage(ready.reason));
  return;
}
openSystemBrowser(authUrl);
Defensive patterns

Strategy: retry

Validate before calling

import { waitForOAuthAuthReadiness } from './oauthAuthReadiness';

const ready = await waitForOAuthAuthReadiness(8000);
if (!ready.ready) {
  // show reason-specific guidance, offer retry
}

Type guard

type Readiness =
  | { ready: true }
  | { ready: false; reason: 'core_mode_unset' | 'core_unreachable' };

Try / catch

try {
  await prepareOAuthLoginLaunch();
} catch (err) {
  // err.message is already user-facing copy from oauthAuthReadinessUserMessage()
  showNotice(err.message, { action: 'retry' });
}

Prevention

When it happens

Trigger: Calling prepareOAuthLoginLaunch() when (a) the stored core mode has not been chosen yet (getStoredCoreMode() unset, e.g. fresh install before onboarding completes), or (b) the local core process fails to start or its HTTP RPC endpoint at 127.0.0.1:<port>/rpc never answers pings within 8000ms, or (c) cloud mode is selected but the remote runtime URL/token is wrong so pingCoreRpc() keeps failing.

Common situations: Fresh install where the user clicks 'Sign in' before finishing the setup screen; core startup slowed by cold start, antivirus scanning the binary, or a stuck update; a crashed/zombie core process from a previous session holding the port; cloud mode configured with a stale RPC URL or expired OPENHUMAN_CORE_TOKEN; CI/test environments with no core binary available.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/e4dcfc41480e7c5e. Report an issue: GitHub.