{"record":{"id":"c383a25065c0a241","repo":"Mintplex-Labs/anything-llm","slug":"error-message-c383a2","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/fireworksai.js","lineNumber":97,"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":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/aibitat/providers/fireworksai.js#L79-L115","documentation":"Fireworks AI 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. Fireworks model ids are long and namespaced (e.g. `accounts/fireworks/models/llama-v3p1-70b-instruct`), so a malformed id is a common APIError source.","triggerScenarios":"Fireworks 429 (per-account RPM/TPM ceiling); 5xx platform incident; APIError from a malformed or unknown model id; stream interrupted mid-reply.","commonSituations":"FIREWORKS_API_KEY invalid or out of quota; model id truncated or missing the `accounts/fireworks/models/` prefix; peak-load throttling; Fireworks deploying a new model version.","solutions":["Inspect the server console — the full error object is logged before rethrow.","Treat RetryError as transient and let the framework retry.","Verify FIREWORKS_API_KEY and the full model id (including the `accounts/fireworks/models/...` prefix).","On repeated 429, raise the Fireworks tier or throttle the request rate.","Check the Fireworks status page."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Validate the full namespaced Fireworks model id before streaming.\nfunction assertFireworksModel(model) {\n  if (!/^accounts\\/[\\w-]+\\/models\\/[\\w.-]+$/.test(model))\n    throw new Error(`Malformed Fireworks model id (expected accounts/<org>/models/<name>): ${model}`);\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 on RetryError.\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();\n  throw e;\n}","preventionTips":["Read server logs — the stream path console.errors the full object.","Use the full `accounts/<org>/models/<name>` id; truncation causes APIError.","Raise the Fireworks tier if RPM/TPM limits recur.","Confirm FIREWORKS_API_KEY is valid; never retry auth."],"tags":["llm-provider","fireworks","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"}