{"record":{"id":"0abce2df9bfec81d","repo":"diegosouzapw/OmniRoute","slug":"refresh-failed","errorCode":"refresh_failed","errorMessage":"Failed to refresh the Claude session before exporting the credentials file. Re-authenticate this account if the session is stale.","messagePattern":"Failed to refresh the Claude session before exporting the credentials file\\. Re-authenticate this account if the session is stale\\.","errorType":"exception","errorClass":"ClaudeAuthFileError","httpStatus":502,"severity":"error","filePath":"src/lib/oauth/utils/claudeAuthFile.ts","lineNumber":219,"sourceCode":"  const refreshed = await getAccessToken(\"claude\", {\n    connectionId,\n    accessToken: connection.accessToken,\n    refreshToken,\n    expiresAt: connection.expiresAt,\n    expiresIn: connection.expiresIn,\n    providerSpecificData: connection.providerSpecificData,\n  });\n\n  if (isUnrecoverableRefreshError(refreshed)) {\n    throw new ClaudeAuthFileError(\n      \"Claude refresh token is no longer valid. Re-authenticate this account before exporting.\",\n      409,\n      \"reauth_required\"\n    );\n  }\n\n  if (!refreshed?.accessToken) {\n    throw new ClaudeAuthFileError(\n      \"Failed to refresh the Claude session before exporting the credentials file. Re-authenticate this account if the session is stale.\",\n      502,\n      \"refresh_failed\"\n    );\n  }\n\n  await updateProviderCredentials(connectionId, refreshed);\n\n  return {\n    ...connection,\n    accessToken: refreshed.accessToken,\n    refreshToken: toNonEmptyString(refreshed.refreshToken) || refreshToken,\n    expiresIn:\n      typeof refreshed.expiresIn === \"number\" ? refreshed.expiresIn : connection.expiresIn || null,\n    expiresAt:\n      typeof refreshed.expiresIn === \"number\"\n        ? new Date(Date.now() + refreshed.expiresIn * 1000).toISOString()\n        : connection.expiresAt || null,","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/claudeAuthFile.ts#L201-L237","documentation":"Error \"Failed to refresh the Claude session before exporting the credentials file. Re-authenticate this account if the session is stale.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/claudeAuthFile.ts:219 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"}