{"record":{"id":"ea9212653115ffa4","repo":"Mintplex-Labs/anything-llm","slug":"error-message-ea9212","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/deepseek.js","lineNumber":156,"sourceCode":"\n    try {\n      return await tooledStream(\n        this.client,\n        this.model,\n        cleanedMessages,\n        functions,\n        eventHandler,\n        this.#tooledOptions\n      );\n    } catch (error) {\n      console.error(error.message, error);\n      if (error instanceof OpenAI.AuthenticationError) throw error;\n      if (\n        error instanceof OpenAI.RateLimitError ||\n        error instanceof OpenAI.InternalServerError ||\n        error instanceof OpenAI.APIError\n      ) {\n        throw new RetryError(error.message);\n      }\n      throw error;\n    }\n  }\n\n  async complete(messages, functions = []) {\n    const useNative = this.supportsNativeToolCalling();\n    const cleanedMessages = this.#stripAttachments(messages);\n\n    if (!useNative) {\n      return await UnTooled.prototype.complete.call(\n        this,\n        cleanedMessages,\n        functions,\n        this.#handleFunctionCallChat.bind(this)\n      );\n    }\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/providers/deepseek.js#L138-L174","documentation":"DeepSeek provider's `stream()` classifies OpenAI SDK errors. It logs `console.error(error.message, error)` first, then re-throws AuthenticationError, wraps RateLimitError/InternalServerError/APIError as `RetryError(error.message)`, and re-throws the rest. DeepSeek is reached via its OpenAI-compatible API; deepseek-chat and deepseek-reasoner are the typical slugs.","triggerScenarios":"DeepSeek 429 (free/reasoner tier throttling during peak CN-business-hours load — very common); DeepSeek 5xx under platform load; APIError from an unknown or retired model slug; stream interrupted mid-reply.","commonSituations":"Free-tier DEEPSEEK_API_KEY exhausted during peak; deepseek-reasoner rate-limited more aggressively than deepseek-chat; model slug typo; DeepSeek platform incident.","solutions":["Inspect the server console — the full error object is logged before rethrow.","Treat RetryError as transient and let the framework retry with backoff.","If repeatedly 429 on reasoner, fall back to deepseek-chat (lighter throttle) or off-peak timing.","Confirm DEEPSEEK_API_KEY is valid and the model slug is current.","Check DeepSeek status/announcements for ongoing incidents."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pick the lighter-throttled model when reasoner is rate-limited.\nfunction pickDeepSeekModel(preferred) {\n  return preferred === 'deepseek-reasoner' ? 'deepseek-reasoner' : 'deepseek-chat';\n}","typeGuard":"function isRetryableProviderError(e) {\n  return e instanceof OpenAI.RateLimitError || e instanceof OpenAI.InternalServerError || e instanceof OpenAI.APIError;\n}","tryCatchPattern":"// Stream path logs via console.error. Retry with backoff; consider model fallback on repeated 429.\ntry { return await provider.stream(messages, functions, handler); }\ncatch (e) {\n  if (e instanceof OpenAI.AuthenticationError) throw e;\n  if (e instanceof RetryError) return await backoffAndRetry({ fallbackModel: 'deepseek-chat' });\n  throw e;\n}","preventionTips":["Read server logs — the stream path console.errors the full object.","Prefer deepseek-chat over reasoner when peak-hour 429s recur.","Confirm DEEPSEEK_API_KEY and current model slug.","Back off exponentially; DeepSeek peak-hour throttling is transient."],"tags":["llm-provider","deepseek","retry","rate-limit","streaming","openai-sdk"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}