{"record":{"id":"a9e15f638b165d91","repo":"can1357/oh-my-pi","slug":"failed-to-fetch-umans-models-info","errorCode":null,"errorMessage":"Failed to fetch Umans models info","messagePattern":"Failed to fetch Umans models info","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/catalog/src/provider-models/openai-compat.ts","lineNumber":862,"sourceCode":"}): Promise<ModelSpec<\"anthropic-messages\">[] | null> {\n\tconst discoveryBaseUrl = toAnthropicDiscoveryBaseUrl(options.baseUrl);\n\tconst requestHeaders: Record<string, string> = { Accept: \"application/json\" };\n\tif (options.apiKey) {\n\t\trequestHeaders[\"x-api-key\"] = options.apiKey;\n\t}\n\tconst fetchImpl = discoveryFetch(options.fetch);\n\tlet payload: unknown;\n\ttry {\n\t\tconst response = await fetchImpl(`${discoveryBaseUrl}${UMANS_MODELS_INFO_PATH}`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: requestHeaders,\n\t\t});\n\t\tif (!response.ok) {\n\t\t\treturn null;\n\t\t}\n\t\tpayload = await response.json();\n\t} catch (error) {\n\t\tthrow new Error(\"Failed to fetch Umans models info\", { cause: error });\n\t}\n\tif (!isRecord(payload)) {\n\t\treturn null;\n\t}\n\tconst models: ModelSpec<\"anthropic-messages\">[] = [];\n\tfor (const [modelId, value] of Object.entries(payload)) {\n\t\tif (!isRecord(value)) continue;\n\t\tconst mapped = mapUmansModelInfo(modelId, value, options.baseUrl, options.references.get(modelId));\n\t\tif (mapped) {\n\t\t\tmodels.push(mapped);\n\t\t}\n\t}\n\treturn models.sort((left, right) => left.id.localeCompare(right.id));\n}\n\nexport function umansModelManagerOptions(config?: UmansModelManagerConfig): ModelManagerOptions<\"anthropic-messages\"> {\n\tconst apiKey = config?.apiKey;\n\tconst baseUrl = normalizeUmansBaseUrl(config?.baseUrl);","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/provider-models/openai-compat.ts#L844-L880","documentation":"The Umans discovery mapper fetches the provider's models info endpoint and wraps ANY fetch/parse failure (network error, timeout, JSON parse error) in this Error with the original attached as `cause`. Note non-ok responses return null instead — this throw is for hard failures, not HTTP statuses.","triggerScenarios":"fetchImpl throws (DNS failure, connection refused, TLS error, abort/timeout) or response.json() rejects while fetching Umans models info.","commonSituations":"Umans API down or unreachable, invalid credentials causing TLS/proxy issues, 5s discovery timeout firing, malformed/non-JSON response body.","solutions":["Check `error.cause` for the underlying failure","Verify network access and the Umans base URL","Retry — discovery timeouts are often transient","If Umans is deprecated/changed, update the provider descriptor or discovery mapper"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  models = await fetchUmansModels();\n} catch (err) {\n  if (err instanceof Error && err.message === \"Failed to fetch Umans models info\") {\n    logger.warn(\"Umans discovery failed\", { cause: (err as { cause?: unknown }).cause });\n    return [];\n  }\n  throw err;\n}","preventionTips":["Always inspect `cause` on this error for the root network failure","Retry once — discovery timeouts are frequently transient","Monitor Umans API status/endpoint changes"],"tags":["network","fetch","discovery"],"backgroundTag":"fetch-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}