{"record":{"id":"fb54cf280b088406","repo":"diegosouzapw/OmniRoute","slug":"stream-readiness-timeout","errorCode":"STREAM_READINESS_TIMEOUT","errorMessage":"${reason}","messagePattern":"\\$\\{reason\\}","errorType":"http","errorClass":null,"httpStatus":504,"severity":"error","filePath":"open-sse/utils/streamReadiness.ts","lineNumber":519,"sourceCode":"\n  const timeoutReason = () =>\n    `Stream produced no non-ping SSE event within ${effectiveTimeoutMs}ms`;\n\n  try {\n    while (true) {\n      const remainingMs = deadline - Date.now();\n      if (remainingMs <= 0) {\n        const reason = timeoutReason();\n        options.log?.warn?.(\n          \"STREAM\",\n          `${reason} (${options.provider || \"provider\"}/${options.model || \"unknown\"})`\n        );\n        await reader.cancel(reason).catch(() => {});\n        return {\n          ok: false,\n          reason,\n          classificationReason: reason,\n          code: \"STREAM_READINESS_TIMEOUT\",\n          type: \"stream_timeout\",\n          response: createErrorResponse(\n            HTTP_STATUS.GATEWAY_TIMEOUT,\n            reason,\n            \"STREAM_READINESS_TIMEOUT\",\n            \"stream_timeout\"\n          ),\n        };\n      }\n\n      let readResult: ReadableStreamReadResult<Uint8Array>;\n      try {\n        readResult = await readWithTimeout(reader, remainingMs);\n      } catch {\n        const reason = timeoutReason();\n        options.log?.warn?.(\n          \"STREAM\",\n          `${reason} (${options.provider || \"provider\"}/${options.model || \"unknown\"})`","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/utils/streamReadiness.ts#L501-L537","documentation":"Error \"${reason}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/utils/streamReadiness.ts:519 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}