{"record":{"id":"b739e0c83dec73fc","repo":"tinyhumansai/openhuman","slug":"chat-applyopenrouterfreemodels-failed","errorCode":null,"errorMessage":"[chat] applyOpenRouterFreeModels failed","messagePattern":"\\[chat\\] applyOpenRouterFreeModels failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/features/conversations/Conversations.tsx","lineNumber":576,"sourceCode":"      if (shouldSyncChatRoute) {\n        debug('[chat][route] created thread thread=%s navigate=true', thread.id);\n        navigate(chatThreadPath(thread.id));\n      } else {\n        debug('[chat][route] created thread thread=%s navigate=false', thread.id);\n      }\n    } catch (error) {\n      debug('[chat] create thread failed: %O', error);\n      setSendError(chatSendError('create_thread_failed', t('chat.createThreadFailed')));\n    }\n  };\n\n  const handleUseOpenRouterFree = async () => {\n    setOpenRouterStatus('saving');\n    try {\n      await applyOpenRouterFreeModels();\n      setOpenRouterStatus('idle');\n    } catch (err) {\n      console.warn('[chat] applyOpenRouterFreeModels failed', err);\n      setOpenRouterStatus('error');\n    }\n  };\n\n  const handleStartEditTitle = (threadId: string) => {\n    const thr = threads.find(t => t.id === threadId);\n    debug('[chat] thread rename: start thread=%s', threadId);\n    setEditTitleValue(thr?.title ?? '');\n    ignoreNextTitleBlurRef.current = true;\n    setEditingThreadId(threadId);\n    const scheduleSelect = window.requestAnimationFrame ?? window.setTimeout;\n    scheduleSelect(() => {\n      editTitleInputRef.current?.select();\n      ignoreNextTitleBlurRef.current = false;\n    });\n  };\n\n  const handleCommitTitle = (threadId: string) => {","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/features/conversations/Conversations.tsx#L558-L594","documentation":"Applying the OpenRouter free-models preset failed in the chat conversations view: the applyOpenRouterFreeModels call (configures OpenRouter free-tier model routes) rejected after the UI set status 'saving'. The handler sets an error status; the model configuration is unchanged, so the chat continues using the previously configured routes.","triggerScenarios":"Thrown at app/src/features/conversations/Conversations.tsx:576 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the console-warned error — auth failure means the OpenRouter key is missing/expired","Verify an OpenRouter API key is configured in provider settings before applying the free-models preset","Retry the apply action once the key/config issue is fixed","Inspect the core log for the inference/routing config write if the error is a validation rejection"],"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"}