{"record":{"id":"aaf5b06ec184ffa2","repo":"tinyhumansai/openhuman","slug":"log-provider-read-failed-kind-errorkind-err","errorCode":null,"errorMessage":"${LOG} provider read failed kind=${errorKind(err)} — treating as unmanaged","messagePattern":"(.+?) provider read failed kind=(.+?) — treating as unmanaged","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/hooks/useEmbeddingBudgetState.ts","lineNumber":222,"sourceCode":"              if (!cancelled) setFallbackUsage(null);\n            } else {\n              console.warn(`${LOG} fallback budget read failed kind=${errorKind(err)}`);\n              if (!cancelled) setFallbackUsage(null);\n            }\n          }\n        } else if (!cancelled) {\n          // Not needed (BYO/local, or `useUsageState` already has the figure).\n          console.debug(\n            `${LOG} fallback budget read not needed ` +\n              `(managed=${managed} hasUsage=${hasUsage} usageLoading=${usageLoading})`\n          );\n          setFallbackUsage(null);\n        }\n      } catch (err) {\n        // Conservative on failure: an unknown provider is treated as\n        // NOT managed, so a transient RPC error can never manufacture a\n        // budget warning for a user who funds their own embeddings.\n        console.warn(`${LOG} provider read failed kind=${errorKind(err)} — treating as unmanaged`);\n        if (!cancelled) {\n          setProvider(null);\n          setFallbackUsage(null);\n        }\n      } finally {\n        if (!cancelled) setProviderLoading(false);\n      }\n    })();\n    return () => {\n      cancelled = true;\n    };\n  }, [reloadCount, isAuthenticated, hasUsage, usageLoading]);\n\n  const isManagedEmbeddings = isManagedEmbeddingProvider(provider);\n\n  // Without this the warning outlives its own fix. The banner is mounted for\n  // the app's lifetime, so a single mount-time read means a user who follows\n  // the CTA and switches to local Ollama keeps being told their memory is","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/hooks/useEmbeddingBudgetState.ts#L204-L240","documentation":"Degraded-path warning in useEmbeddingBudgetState: the provider (managed-inference) status read failed and the hook deliberately downgrades the session to 'unmanaged' rather than erroring out. Consequence: no usage ceiling is displayed and BYO-style behavior is assumed even though the account may actually be managed.","triggerScenarios":"Thrown at app/src/hooks/useEmbeddingBudgetState.ts:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Accept the downgrade for the session but re-attempt the provider read on reconnect","Distinguish auth failures (prompt re-login) from transient network kinds","Log the endpoint that failed to make persistent cases diagnosable"],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}