{"record":{"id":"a50db89bfb5dc8cd","repo":"diegosouzapw/OmniRoute","slug":"raycast-device-analytics-id-not-found-launch-ray","errorCode":null,"errorMessage":"Raycast device/analytics ID not found — launch Raycast once so it writes local state","messagePattern":"Raycast device/analytics ID not found — launch Raycast once so it writes local state","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/oauth/services/raycastLocal.ts","lineNumber":179,"sourceCode":"export function extractLocalRaycastCredentials(): RaycastLocalCredentials {\n  if (process.platform !== \"darwin\") {\n    throw new Error(\"Raycast auto-import is macOS-only\");\n  }\n\n  const store = readKeychainJson(\"raycast-store_credentials\");\n  const oauth = (store?.oauth || {}) as { access_token?: string };\n  const accessToken = oauth.access_token?.trim();\n  if (!accessToken) {\n    throw new Error(\n      \"Raycast bearer token not found in Keychain — open Raycast and sign in first\"\n    );\n  }\n\n  const analyticsFromDb = readAnalyticsIdFromDb();\n  const analyticsFromPosthog = readAnalyticsIdFromPosthog();\n  const deviceId = analyticsFromDb || analyticsFromPosthog;\n  if (!deviceId) {\n    throw new Error(\n      \"Raycast device/analytics ID not found — launch Raycast once so it writes local state\"\n    );\n  }\n\n  const profile = readUserProfile();\n  const user = (store?.user || {}) as { email?: string; username?: string };\n\n  return {\n    accessToken,\n    deviceId,\n    // V1 JWT aid — chat works without a captured signature JWT; deviceId is a stable fallback.\n    aid: deviceId,\n    email: profile.email || user.email,\n    username: profile.username || user.username,\n    hasProFeatures: profile.hasProFeatures,\n    hasBetterAI: profile.hasBetterAI,\n    source: analyticsFromDb ? \"keychain+analyticsId\" : \"keychain+posthog\",\n  };","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/services/raycastLocal.ts#L161-L197","documentation":"Error \"Raycast device/analytics ID not found — launch Raycast once so it writes local state\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/services/raycastLocal.ts:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}