diegosouzapw/OmniRoute · error

[BATCH] Item exceeded 24h retry window after attempts —…

Error message

[BATCH] Item ${item.customId ?? "(no id)"} exceeded 24h retry window after ${attempt} attempts — giving up

What it means

Per-item retry budget exhaustion in the batch processor: an item kept receiving 429/502/504 from the provider and the cumulative retry time exceeded the 24h window after `attempt` attempts, so the processor gives up and marks the item failed rather than retrying indefinitely. Rate-limit throttling (Retry-After aware) was applied between attempts but was insufficient.

Solutions

  1. Retry the failed item in a new batch once the provider recovers or quota resets.
  2. Check provider quota/plan limits causing persistent 429s and raise limits or reduce batch concurrency.
  3. Honor Retry-After/reset headers more aggressively or add exponential backoff with jitter.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at open-sse/services/batchProcessor.ts:495 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/9d2eab0ead4ec3b6. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/services/batchProcessor.ts:495

  let response: Response = null;
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
    // If the previous attempt got a response, check for rate limit headers and throttle if needed before retrying.
    if (response) {
      const delay = maybeThrottle(response.headers);
      if (delay) {
        await sleep(delay);
      }
    }

    response = await processSingleItem(item, apiKey);

    if (
      (response.status === 429 || response.status === 502 || response.status === 504) &&
      attempt < maxRetries
    ) {
      // Bail if we've been retrying for longer than the allowed window
      if (Date.now() - retryStartedAt >= MAX_RETRY_DURATION_MS) {
        console.warn(
          `[BATCH] Item ${item.customId ?? "(no id)"} exceeded 24h retry window after ${attempt} attempts — giving up`
        );
        return response;
      }
      const delay = getRetryDelayMs(response.headers) ?? getBackoffDelayMs(attempt);
      await sleep(delay);
      continue;
    }

    return response;
  }
}

// G10 (silent-stop fix): individual batch-item dispatches can hang indefinitely
// if the upstream route stalls (no signal/timeout plumbed through). Bound each
// item with a wall-clock timeout so a stuck item fails fast (recorded as an item
// error) instead of freezing the whole batch loop. The orphaned dispatch keeps
// running in the background but can no longer block the batch.

View on GitHub (pinned to a179ffed5b)