{"record":{"id":"41c6e8a91887d333","repo":"tinyhumansai/openhuman","slug":"onboarding-api-keys-oauth-start-failed","errorCode":null,"errorMessage":"[onboarding:api-keys] oauth start failed","messagePattern":"\\[onboarding:api-keys\\] oauth start failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/pages/onboarding/steps/ApiKeysStep.tsx","lineNumber":76,"sourceCode":"    if (!isTauri()) {\n      setError(t('onboarding.apiKeys.oauthDesktopOnly'));\n      return;\n    }\n    setOauthBusy(true);\n    setError(null);\n    try {\n      const res = await callCoreRpc<{ result: { authUrl: string } }>({\n        method: 'openhuman.inference_openai_oauth_start',\n        params: {},\n      });\n      const authUrl = res?.result?.authUrl?.trim();\n      if (!authUrl) {\n        throw new Error('missing authUrl');\n      }\n      setOauthAwaitingCallback(true);\n      await openUrl(authUrl);\n    } catch (err) {\n      console.warn('[onboarding:api-keys] oauth start failed', err);\n      setError(t('onboarding.apiKeys.oauthStartFailed'));\n    } finally {\n      setOauthBusy(false);\n    }\n  };\n\n  const handleOpenAiOAuthComplete = async () => {\n    const callback = oauthCallbackUrl.trim();\n    if (!callback) {\n      setError(t('onboarding.apiKeys.oauthPasteRedirect'));\n      return;\n    }\n    setOauthBusy(true);\n    setError(null);\n    try {\n      await callCoreRpc({\n        method: 'openhuman.inference_openai_oauth_complete',\n        params: { callback_url: callback },","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/pages/onboarding/steps/ApiKeysStep.tsx#L58-L94","documentation":"Starting the OpenAI OAuth flow failed during onboarding API-key setup: the inference_openai_oauth_start RPC either rejected, returned no authUrl, or the subsequent openUrl of the auth page threw. The user is left on the step with oauthBusy cleared; setOauthAwaitingCallback stays false so the paste-callback UI is not shown.","triggerScenarios":"Thrown at app/src/pages/onboarding/steps/ApiKeysStep.tsx:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the warned error — desktop-only guard: this path requires isTauri(), and non-Tauri shows a dedicated message before the RPC","Retry the connect button; transient RPC/core failures clear on the next attempt","If authUrl was missing in the response, inspect the core log for the OAuth start handler","Manual fallback: paste an OpenAI API key instead of using OAuth"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}