{"record":{"id":"789ec0f4b82e2a78","repo":"different-ai/openwork","slug":"failed-to-load-provider-details-response-status","errorCode":null,"errorMessage":"Failed to load provider details (${response.status}).","messagePattern":"Failed to load provider details \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/llm-provider-data.tsx","lineNumber":484,"sourceCode":"  const { response, payload } = await requestJson(`/v1/llm-provider-catalog`, { method: \"GET\" }, 20000);\n  if (!response.ok) {\n    throw new Error(getErrorMessage(payload, `Failed to load the provider catalog (${response.status}).`));\n  }\n\n  return isRecord(payload) && Array.isArray(payload.providers)\n    ? payload.providers.map(asCatalogProviderSummary).filter((entry): entry is DenModelsDevProviderSummary => entry !== null)\n    : [];\n}\n\nexport async function requestLlmProviderCatalogDetail(orgId: string, providerId: string) {\n  const { response, payload } = await requestJson(\n    `/v1/llm-provider-catalog/${encodeURIComponent(providerId)}`,\n    { method: \"GET\" },\n    20000,\n  );\n\n  if (!response.ok) {\n    throw new Error(getErrorMessage(payload, `Failed to load provider details (${response.status}).`));\n  }\n\n  if (!isRecord(payload) || !payload.provider) {\n    throw new Error(\"Provider details were missing from the response.\");\n  }\n\n  const detail = asCatalogProviderDetail(payload.provider);\n  if (!detail) {\n    throw new Error(\"Provider details could not be parsed.\");\n  }\n\n  return detail;\n}\n\nexport function useOrgLlmProviders(\n  orgId: string | null,\n  options: { scope?: \"usable\" | \"manageable\" } = {},\n) {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/llm-provider-data.tsx#L466-L502","documentation":"requestLlmProviderCatalogDetail GETs /v1/llm-provider-catalog/:providerId; on a non-ok response it throws with the server message or embedded status. This is the transport-level guard before the payload is schema-checked.","triggerScenarios":"The detail endpoint returns 401/403, 404 (unknown providerId in the path or route missing), or 5xx; providerId contains characters that, even after encodeURIComponent, resolve to a nonexistent catalog entry server-side.","commonSituations":"Stale frontend cache referencing a provider id removed from the catalog; typo'd/stale providerId passed from a saved config; session expiry; server version without the detail route.","solutions":["Check response.status — 404 means the providerId does not exist server-side; verify the id against GET /v1/llm-provider-catalog.","Re-authenticate if status is 401/403.","Refresh the catalog list so the UI only offers currently-valid provider ids.","Confirm server deployment includes the detail route."],"exampleFix":"// before\nthrow new Error(getErrorMessage(payload, `Failed to load provider details (${response.status}).`));\n// after\nif (response.status === 404) throw new Error(`Provider \"${providerId}\" was not found in the catalog.`);\nthrow new Error(getErrorMessage(payload, `Failed to load provider details (${response.status}).`));","handlingStrategy":"try-catch","validationCode":"// verify the providerId exists in the already-loaded catalog before requesting details\nconst exists = catalogProviders.some((p) => p.id === providerId);\nif (!exists) throw new Error(`Unknown provider: ${providerId}`);","typeGuard":null,"tryCatchPattern":"try {\n  const detail = await requestLlmProviderCatalogDetail(providerId);\n} catch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  if (msg.includes(\"(404)\")) show(\"Provider not found — refresh the catalog.\");\n  else show(msg);\n}","preventionTips":["Only offer provider ids sourced from the live catalog list, not stale saved configs.","Re-fetch the catalog when a 404 on detail is received.","Keep providerId selection typed to the catalog's id union where feasible.","Ensure encodeURIComponent is always applied (it is) and ids contain no surprises server-side."],"tags":["network","http-status","llm-provider-catalog","den-web"],"backgroundTag":"http-request-failed","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}