{"record":{"id":"bd1050ec9d1fe2a6","repo":"deepseek-ai/deepseek-harness","slug":"deepseek-api-error-http-response-status","errorCode":null,"errorMessage":"DeepSeek API error (HTTP ${response.status})","messagePattern":"DeepSeek API error \\(HTTP (.+?)\\)","errorType":"http","errorClass":"LlmError","httpStatus":null,"severity":"error","filePath":"packages/llm/llm-deepseek/src/adapter.ts","lineNumber":651,"sourceCode":"        const detail = [providerError?.code, providerError?.type, providerError?.message]\n          .filter((field): field is string => typeof field === 'string')\n          .join(' ')\n        const staleFile = usedFiles.length > 0 && providerRejectedFileId(detail)\n        if (staleFile) {\n          await Promise.all(staleMappings(usedFiles, detail).map(file => (\n            this.files.invalidate(file.version, file.fileId, fileConnection)\n          )))\n          if (fileAttempt === 0) {\n            fileAttempt += 1\n            continue\n          }\n        }\n        if (response.status === 400 && usedFiles.length > 0 && providerRejectedNormalizedImage(detail)) {\n          message = normalizedImageDiagnostic(usedFiles, message, detail)\n        }\n        const delay = providerRetryAfterMs(response.headers.get('retry-after'))\n        const id = requestId(response.headers)\n        throw new LlmError(message, httpErrorCode(response.status, providerError), {\n          cause: new Error(rawResponse.length > 0 ? rawResponse : `DeepSeek HTTP ${response.status}`),\n          status: response.status,\n          ...delay === undefined ? {} : { providerRetryAfterMs: delay },\n          ...id === undefined ? {} : { requestId: id },\n        })\n      }\n      if (!response.body) {\n        throw new LlmError('DeepSeek API returned no response body', 'EMPTY_RESPONSE')\n      }\n\n      yield* translate(parseSse(response.body, onActivity))\n      return\n    }\n  }\n}\n","sourceCodeStart":633,"sourceCodeEnd":667,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm-deepseek/src/adapter.ts#L633-L667","documentation":"Error \"DeepSeek API error (HTTP ${response.status})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm-deepseek/src/adapter.ts:651 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Act on the HTTP status: fix the API key for 401, back off for 429, and inspect the response body for other statuses."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}