{"record":{"id":"cce29f0bf209b5b6","repo":"Mintplex-Labs/anything-llm","slug":"error-message-cce29f","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/omlx.js","lineNumber":108,"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  /**\n   * Create a non-streaming completion with tool calling support.\n   * Uses native tool calling when supported, otherwise falls back to UnTooled.\n   */\n  async complete(messages, functions = []) {\n    const useNative = await this.supportsNativeToolCalling();\n\n    if (!useNative) {\n      return await UnTooled.prototype.complete.call(\n        this,\n        messages,\n        functions,\n        this.#handleFunctionCallChat.bind(this)","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/agents/aibitat/providers/omlx.js#L90-L126","documentation":"OMLXProvider.stream() catches failures from the streaming tool-call request (tooledStream) to the OMLX endpoint (parseOMLXBasePath(OMLX_LLM_BASE_PATH)) and rethrows OpenAI RateLimitError, InternalServerError, or any APIError as aibitat's RetryError with the original message; AuthenticationError is rethrown raw; unknown errors pass through. console.error logs the full raw error first, so the console is the best diagnostic source. As with all these providers, APIError is the SDK's base HTTP-error class, so a 404 for a wrong model id is wrapped identically to transient 429/5xx.","triggerScenarios":"Streaming chat.completions.create against the OMLX base path returning 429 (service concurrency/rate cap), 5xx (model backend failure), 404/400 (model id from OMLX_LLM_MODEL_PREF not served), or auth misalignment where a non-401 rejection (e.g. 403) is wrapped.","commonSituations":"OMLX_LLM_BASE_PATH malformed (parseOMLXBasePath still builds a URL, but the wrong one 404s); OMLX_LLM_API_KEY stale so protected routes reject; shared OMLX endpoint saturated by other tenants; model id typo'd in env.","solutions":["Read the console log for the raw status: 429 -> back off, 5xx -> retry, 404/400 -> fix model or base path","Confirm OMLX_LLM_MODEL_PREF matches an id the OMLX service actually serves","Verify OMLX_LLM_BASE_PATH is the documented API root and the service is reachable","Refresh OMLX_LLM_API_KEY if the endpoint enforces auth"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const base = parseOMLXBasePath(process.env.OMLX_LLM_BASE_PATH);\nconst res = await fetch(`${base}/models`, {\n  headers: process.env.OMLX_LLM_API_KEY ? { Authorization: `Bearer ${process.env.OMLX_LLM_API_KEY}` } : {},\n});\nif (!res.ok) throw new Error(`OMLX pre-flight failed (${res.status}) — check OMLX_LLM_BASE_PATH`);","typeGuard":"const { RetryError } = require(\"./server/utils/agents/aibitat/error.js\");\nconst isRetryError = (e) => e instanceof RetryError;\nconst isTransientOmlx = (e) => isRetryError(e) && /429|5\\d\\d/.test(String(e.message));","tryCatchPattern":"try {\n  return await provider.stream(messages, functions, eventHandler);\n} catch (error) {\n  if (error instanceof OpenAI.AuthenticationError) throw error;\n  if (isTransientOmlx(error)) { await sleep(15_000); return provider.stream(messages, functions, eventHandler); }\n  throw error; // 404/400: model id or base path wrong\n}","preventionTips":["Smoke-test OMLX_LLM_BASE_PATH with curl before wiring agents to it","Keep OMLX_LLM_MODEL_PREF synchronized with ids the service actually serves","Use the console log — the raw error is printed at this site","Pre-flight /models on boot so wrong base paths fail fast"],"tags":["llm-provider","omlx","openai-sdk","retry-error","streaming"],"backgroundTag":"openai-api-error","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}