{"record":{"id":"c871f538738c058a","repo":"vercel/ai","slug":"fireworks-image-generation-timed-out-after-pollt","errorCode":null,"errorMessage":"Fireworks image generation timed out after ${pollTimeoutMillis}ms","messagePattern":"Fireworks image generation timed out after (.+?)ms","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fireworks/src/fireworks-image-model.ts","lineNumber":382,"sourceCode":"        if (typeof imageUrl === 'string') {\n          return imageUrl;\n        }\n        throw new Error(\n          'Fireworks poll response is Ready but missing result.sample',\n        );\n      }\n\n      if (status === 'Error' || status === 'Failed') {\n        throw new Error(\n          `Fireworks image generation failed with status: ${status}`,\n        );\n      }\n\n      // Wait before next poll attempt\n      await delay(pollIntervalMillis);\n    }\n\n    throw new Error(\n      `Fireworks image generation timed out after ${pollTimeoutMillis}ms`,\n    );\n  }\n}\n","sourceCodeStart":364,"sourceCodeEnd":387,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/fireworks/src/fireworks-image-model.ts#L364-L387","documentation":"The Fireworks image model polls with a bounded total wait (pollTimeoutMillis). If the request never reaches a terminal state within that budget, the loop exits and throws this timeout Error. It reflects Fireworks-side processing taking longer than the client is willing to wait.","triggerScenarios":"Calling `fireworks.image(...).doGenerate` where the generation request stays queued/InFlight longer than pollTimeoutMillis (default configured in the model) — overloaded Fireworks queue or very large/expensive generation.","commonSituations":"Generating many images concurrently causing queue delays; very high resolution or many-step generations; Fireworks capacity issues; too-short timeout configured for the chosen model.","solutions":["Increase the image model's timeout configuration (maxPollTimeoutMillis / pollTimeoutMillis option)","Retry the request, ideally with fewer concurrent generations","Reduce image size/steps to shorten generation time","Check Fireworks status for capacity incidents"],"exampleFix":"// before\nconst model = fireworks.image('accounts/fireworks/models/flux1-dev-fp8');\n// after\nconst model = fireworks.image('accounts/fireworks/models/flux1-dev-fp8', {\n  maxPollTimeoutMillis: 120_000,\n});","handlingStrategy":"retry","validationCode":"// configure a timeout proportional to generation cost before calling\nconst isExpensive = (opts.steps ?? 28) > 28 || opts.size?.includes('2048');\nconst timeoutMs = isExpensive ? 180_000 : 60_000;","typeGuard":"function isFireworksPollTimeout(e: unknown): boolean {\n  return e instanceof Error && e.message.startsWith('Fireworks image generation timed out after');\n}","tryCatchPattern":"try {\n  return await generateImage({ model, prompt });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Fireworks image generation timed out after')) {\n    return retryWithLargerTimeout(() => generateImage({ model, prompt }));\n  }\n  throw e;\n}","preventionTips":["Raise the image model's poll timeout for large or multi-step generations","Throttle concurrency so Fireworks queue delays don't compound","Add retry with backoff for timeout errors","Reduce image resolution/steps when latency budgets are tight"],"tags":["timeout","image-generation","polling","fireworks"],"backgroundTag":"request-timeout","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}