{"record":{"id":"5092ab2fcfe3175b","repo":"different-ai/openwork","slug":"failed-to-load-the-oauth-client-response-status","errorCode":null,"errorMessage":"Failed to load the OAuth client (${response.status}).","messagePattern":"Failed to load the OAuth client \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx","lineNumber":1074,"sourceCode":"}\n\nexport function useNativeProviderClient(providerId: string, enabled: boolean) {\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useQuery({\n    enabled: enabled && Boolean(orgId),\n    queryKey: mcpConnectionQueryKeys.nativeProviderClient(orgId, providerId),\n    retry: false,\n    queryFn: async (): Promise<NativeProviderClient> => {\n      let client: NativeProviderClient | null = null;\n      await runReauthableAction(\"load-native-oauth-client\", async () => {\n        const { response, payload } = await requestJson(\n          `/v1/oauth-providers/${encodeURIComponent(providerId)}/client`,\n          { headers: getOrgScopeHeaders(requireOrgId(orgId)) },\n          15000,\n        );\n        if (!response.ok) {\n          throw getRequestError(payload, response, `Failed to load the OAuth client (${response.status}).`);\n        }\n        client = parseNativeProviderClient(payload);\n      });\n      if (!client) {\n        throw new Error(\"Native provider client response was incomplete.\");\n      }\n      return client;\n    },\n  });\n}\n\nexport function formatMcpConnectedTimestamp(value: string | null): string {\n  if (!value) return \"Not connected\";\n  const date = new Date(value);\n  if (Number.isNaN(date.getTime())) return \"Not connected\";\n  return new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\", year: \"numeric\" }).format(date);\n}\n","sourceCodeStart":1056,"sourceCodeEnd":1092,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx#L1056-L1092","documentation":"Error \"Failed to load the OAuth client (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx:1074 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}