{"record":{"id":"8840b5450c05e9b1","repo":"tinyhumansai/openhuman","slug":"onboarding-api-keys-oauth-complete-failed","errorCode":null,"errorMessage":"[onboarding:api-keys] oauth complete failed","messagePattern":"\\[onboarding:api-keys\\] oauth complete failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/pages/onboarding/steps/ApiKeysStep.tsx","lineNumber":100,"sourceCode":"\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 },\n      });\n      setOauthCallbackUrl('');\n      setOauthAwaitingCallback(false);\n      setOauthConnected(true);\n    } catch (err) {\n      console.warn('[onboarding:api-keys] oauth complete failed', err);\n      setError(t('onboarding.apiKeys.oauthCompleteFailed'));\n    } finally {\n      setOauthBusy(false);\n    }\n  };\n\n  const handleSave = async () => {\n    const trimmedOpenai = openai.trim();\n    const trimmedAnthropic = anthropic.trim();\n    if (!trimmedOpenai && !trimmedAnthropic && !oauthConnected) {\n      onSkip();\n      return;\n    }\n\n    setSaving(true);\n    setError(null);\n    try {\n      if (trimmedOpenai) {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/pages/onboarding/steps/ApiKeysStep.tsx#L82-L118","documentation":"Completing the OpenAI OAuth flow failed during onboarding: the inference_openai_oauth_complete RPC rejected for the pasted callback URL (params.callback_url). The step sets a visible error; oauthAwaitingCallback stays true and the callback URL is kept so the user can retry or correct the paste. Typical causes: malformed/truncated callback URL, code already redeemed, or provider/client-id mismatch core-side.","triggerScenarios":"Thrown at app/src/pages/onboarding/steps/ApiKeysStep.tsx:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-copy the full redirect URL from the browser address bar — truncation is the most common cause","Check the step's error message for the core's rejection reason (invalid code, expired state)","Retry submit with the corrected URL; a code can be single-use, so re-run 'Connect' to start a fresh flow if it was already redeemed","Fall back to pasting an API key if OAuth repeatedly fails"],"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"}