diegosouzapw/OmniRoute · error

STREAM_READINESS_TIMEOUT

STREAM_READINESS_TIMEOUT

Error message

${reason}

What it means

Stream readiness probe timed out (STREAM_READINESS_TIMEOUT): the upstream SSE produced no non-ping event within effectiveTimeoutMs, so the probe cancels the reader and reports failure with the timeout reason — the provider accepted the connection but never started streaming real content.

Solutions

  1. Retry the request; first-token stalls are often transient
  2. Increase the readiness timeout for slow-thinking models
  3. Check provider status — a hung upstream or stuck queue is likely
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at open-sse/utils/streamReadiness.ts:519 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/fb54cf280b088406. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/utils/streamReadiness.ts:519

  const timeoutReason = () =>
    `Stream produced no non-ping SSE event within ${effectiveTimeoutMs}ms`;

  try {
    while (true) {
      const remainingMs = deadline - Date.now();
      if (remainingMs <= 0) {
        const reason = timeoutReason();
        options.log?.warn?.(
          "STREAM",
          `${reason} (${options.provider || "provider"}/${options.model || "unknown"})`
        );
        await reader.cancel(reason).catch(() => {});
        return {
          ok: false,
          reason,
          classificationReason: reason,
          code: "STREAM_READINESS_TIMEOUT",
          type: "stream_timeout",
          response: createErrorResponse(
            HTTP_STATUS.GATEWAY_TIMEOUT,
            reason,
            "STREAM_READINESS_TIMEOUT",
            "stream_timeout"
          ),
        };
      }

      let readResult: ReadableStreamReadResult<Uint8Array>;
      try {
        readResult = await readWithTimeout(reader, remainingMs);
      } catch {
        const reason = timeoutReason();
        options.log?.warn?.(
          "STREAM",
          `${reason} (${options.provider || "provider"}/${options.model || "unknown"})`

View on GitHub (pinned to a179ffed5b)