{"record":{"id":"165d898dee36a92c","repo":"tinyhumansai/openhuman","slug":"onboarding-api-keys-save-failed","errorCode":null,"errorMessage":"[onboarding:api-keys] save failed","messagePattern":"\\[onboarding:api-keys\\] save failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/pages/onboarding/steps/ApiKeysStep.tsx","lineNumber":126,"sourceCode":"    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) {\n        await setCloudProviderKey('openai', trimmedOpenai);\n      }\n      if (trimmedAnthropic) {\n        await setCloudProviderKey('anthropic', trimmedAnthropic);\n      }\n      onNext();\n    } catch (err) {\n      console.warn('[onboarding:api-keys] save failed', err);\n      setError(t('onboarding.apiKeys.saveError'));\n    } finally {\n      setSaving(false);\n    }\n  };\n\n  return (\n    <div\n      data-testid=\"onboarding-api-keys-step\"\n      className=\"rounded-2xl bg-surface p-10 shadow-soft animate-fade-up\">\n      <div className=\"text-center\">\n        <h1 className=\"text-2xl font-title text-content mb-2 leading-tight\">\n          {t('onboarding.apiKeys.title')}\n        </h1>\n        <p className=\"text-content-muted text-sm leading-relaxed\">\n          {t('onboarding.apiKeys.subtitle')}\n        </p>\n      </div>","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/pages/onboarding/steps/ApiKeysStep.tsx#L108-L144","documentation":"Saving the onboarding API keys step failed: setCloudProviderKey rejected for the openai and/or anthropic key being persisted. The step shows a generic save error and stays on the step (saving cleared in finally); no key that failed mid-sequence is retried, so a partial save is possible when the first key succeeds and the second fails.","triggerScenarios":"Thrown at app/src/pages/onboarding/steps/ApiKeysStep.tsx:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the console-warned error for whether one or both provider key writes failed","Verify core/session health and retry Continue — successful keys are re-written harmlessly","If a key is rejected as invalid, correct it in the step before retrying","Skip is available if the user prefers to add keys later in settings"],"exampleFix":null,"handlingStrategy":"try-catch","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"}