{"record":{"id":"50397d474155271c","repo":"Mintplex-Labs/anything-llm","slug":"error-message-50397d","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"warning","filePath":"server/utils/agents/aibitat/providers/giteeai.js","lineNumber":91,"sourceCode":"\n    try {\n      return await tooledStream(\n        this.client,\n        this.model,\n        messages,\n        functions,\n        eventHandler,\n        { provider: this }\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\n    if (!useNative) {\n      return await UnTooled.prototype.complete.call(\n        this,\n        messages,\n        functions,\n        this.#handleFunctionCallChat.bind(this)\n      );\n    }\n\n    try {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/providers/giteeai.js#L73-L109","documentation":"GiteeAiProvider.stream() catch (giteeai.js:84-95) rethrows RateLimitError/InternalServerError/APIError as RetryError(error.message) and logs via console.error; AuthenticationError is rethrown. This is the Gitee AI (Serverless OpenAI-compatible) provider.","triggerScenarios":"Gitee AI returns 429, 5xx, or a non-auth APIError during a streaming tooled completion.","commonSituations":"Gitee AI free-tier rate limits, a wrong model id, an expired/invalid token surfaced as APIError, or upstream Gitee AI maintenance.","solutions":["Verify the Gitee AI API key and base path configuration.","Confirm the model id is in Gitee AI's catalog.","Lower request rate / add backoff for 429s.","Let the AIbitat retry loop handle transient 5xx.","Reproduce with curl to capture the exact upstream message."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!process.env.GITEE_AI_API_KEY && !process.env.GITEEAI_API_KEY)\n  throw new Error(\"Gitee AI API key is not set.\");","typeGuard":null,"tryCatchPattern":"const { RetryError } = require(\"./server/utils/agents/aibitat/error.js\");\ntry {\n  return await provider.stream(messages, functions, handler);\n} catch (e) {\n  if (e instanceof RetryError && attempt < MAX) {\n    await new Promise((r) => setTimeout(r, 1000 * attempt));\n    return await provider.stream(messages, functions, handler);\n  }\n  throw e;\n}","preventionTips":["Confirm the Gitee AI key and base path at startup.","Pick a model id from Gitee AI's catalog before the first call.","Let RetryError flow to the framework's retry loop.","Reproduce persistent failures with curl to see the raw upstream error."],"tags":["giteeai","retry","config","transient","openai-sdk"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}