diegosouzapw/OmniRoute · error · Error

Raycast device/analytics ID not found — launch Raycast once…

Error message

Raycast device/analytics ID not found — launch Raycast once so it writes local state

What it means

extractLocalRaycastCredentials found the Keychain Bearer token, but neither the local app DB (user.analyticsId) nor the posthog distinct-id file yielded a device/analytics ID. The analytics state is only written after Raycast has actually run and initialized telemetry, hence the instruction to launch it once.

Solutions

  1. Launch and interact with Raycast once so it writes analytics state, then retry auto-import
  2. If it persists, check the Raycast DB and posthog distinct-id file paths exist and are readable (sqlcipher installed)
  3. Fall back to manual deviceId entry if the local state cannot be produced
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/oauth/services/raycastLocal.ts:179 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/a50db89bfb5dc8cd. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/services/raycastLocal.ts:179

export function extractLocalRaycastCredentials(): RaycastLocalCredentials {
  if (process.platform !== "darwin") {
    throw new Error("Raycast auto-import is macOS-only");
  }

  const store = readKeychainJson("raycast-store_credentials");
  const oauth = (store?.oauth || {}) as { access_token?: string };
  const accessToken = oauth.access_token?.trim();
  if (!accessToken) {
    throw new Error(
      "Raycast bearer token not found in Keychain — open Raycast and sign in first"
    );
  }

  const analyticsFromDb = readAnalyticsIdFromDb();
  const analyticsFromPosthog = readAnalyticsIdFromPosthog();
  const deviceId = analyticsFromDb || analyticsFromPosthog;
  if (!deviceId) {
    throw new Error(
      "Raycast device/analytics ID not found — launch Raycast once so it writes local state"
    );
  }

  const profile = readUserProfile();
  const user = (store?.user || {}) as { email?: string; username?: string };

  return {
    accessToken,
    deviceId,
    // V1 JWT aid — chat works without a captured signature JWT; deviceId is a stable fallback.
    aid: deviceId,
    email: profile.email || user.email,
    username: profile.username || user.username,
    hasProFeatures: profile.hasProFeatures,
    hasBetterAI: profile.hasBetterAI,
    source: analyticsFromDb ? "keychain+analyticsId" : "keychain+posthog",
  };

View on GitHub (pinned to a179ffed5b)