{"record":{"id":"4737f2ac4e8268d6","repo":"can1357/oh-my-pi","slug":"failed-to-fetch-clinepass-models-http-response","errorCode":null,"errorMessage":"Failed to fetch ClinePass models: HTTP ${response.status}","messagePattern":"Failed to fetch ClinePass models: HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/catalog/src/provider-models/openai-compat.ts","lineNumber":2686,"sourceCode":"\t\t...(reasoning ? {} : { thinking: undefined }),\n\t\tcompat: { supportsReasoningEffort: false, wireModelIdMode: \"raw\" },\n\t};\n}\n\nasync function fetchClinePassModels(\n\tfetchImpl: FetchImpl,\n\treferences: ReadonlyMap<string, ModelSpec<\"openai-completions\">>,\n): Promise<ModelSpec<\"openai-completions\">[]> {\n\t// The roster is authoritative for ids; the live reference catalog is a pure\n\t// enrichment tier fetched alongside and tolerated away (offline → bundle).\n\tconst [response, liveCatalog] = await Promise.all([\n\t\twithCatalogDiscoveryTimeout(5_000, signal =>\n\t\t\tfetchImpl(CLINEPASS_MODELS_URL, { signal, headers: clinePassClientHeaders() }),\n\t\t),\n\t\tfetchClinePassLiveCatalog(fetchImpl),\n\t]);\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to fetch ClinePass models: HTTP ${response.status}`);\n\t}\n\tconst payload: unknown = await response.json();\n\tif (!isRecord(payload) || !Array.isArray(payload.clinePass)) {\n\t\tthrow new Error(\"ClinePass model catalog response is missing clinePass\");\n\t}\n\n\tconst models = new Map<string, ModelSpec<\"openai-completions\">>();\n\tfor (const entry of payload.clinePass) {\n\t\tif (!isRecord(entry) || typeof entry.id !== \"string\") {\n\t\t\tcontinue;\n\t\t}\n\t\tconst wireId = entry.id.trim();\n\t\tif (!wireId.startsWith(\"cline-pass/\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst id = toClinePassPublicModelId(wireId).trim();\n\t\tif (!id) {\n\t\t\tcontinue;","sourceCodeStart":2668,"sourceCodeEnd":2704,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/provider-models/openai-compat.ts#L2668-L2704","documentation":"ClinePass discovery fetches the static models catalog and the live catalog in parallel and throws this when the static catalog response status is not ok. The status code is included to distinguish auth vs server vs not-found problems.","triggerScenarios":"GET CLINEPASS_MODELS_URL (with a 5s catalog timeout) returns 4xx/5xx — e.g. 401 for a bad/expired key, 404 if the endpoint moved, 5xx on outage.","commonSituations":"Expired ClinePass API key, ClinePass API URL change after a provider update, corporate proxy blocking the request, transient server outage.","solutions":["Check the HTTP status in the message: 401/403 → fix the ClinePass API key; 404 → endpoint changed, update package","Retry — the fetch has a 5s timeout that may have been hit upstream","Verify network/proxy access to the ClinePass API host","Update to the latest catalog version in case the endpoint URL changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  models = await fetchClinePassModels();\n} catch (err) {\n  const m = err instanceof Error ? err.message : \"\";\n  if (/ClinePass models: HTTP 4\\d\\d/.test(m)) {\n    logger.error(\"ClinePass auth rejected; refresh API key\", { status: m });\n  } else if (m.includes(\"ClinePass models: HTTP\")) {\n    logger.warn(\"ClinePass transient error; retrying\", { cause: err });\n    return retry();\n  }\n  throw err;\n}","preventionTips":["Keep the ClinePass API key valid and rotated","Check the status code in the message before choosing a fix","Update the catalog package when ClinePass changes endpoints"],"tags":["network","http","discovery"],"backgroundTag":"http-request-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}