diegosouzapw/OmniRoute · error

Refusing to persist rateLimitOverrides with rejected keys: $

Error message

Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(", ")}

What it means

Error "Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(", ")}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/db/providers.ts:686

  // to no-overrides) keeps the field present on the returned object so the
  // UI can tell "field was read, no overrides" apart from "field absent."
  if ("quotaWindowThresholds" in connection) {
    const result = sanitizeQuotaWindowThresholds(connection.quotaWindowThresholds);
    if (result.rejected.length > 0) {
      throw new Error(
        `Refusing to persist quotaWindowThresholds with rejected keys: ${result.rejected.join(", ")}`
      );
    }
    connection.quotaWindowThresholds = result.sanitized;
  }

  // Same sanitization for rateLimitOverrides — keep in-memory representation
  // in sync with what gets persisted. Reject (don't silently drop) invalid
  // keys/values so a direct DB writer can't lose operator intent.
  if ("rateLimitOverrides" in connection) {
    const result = sanitizeRateLimitOverrides(connection.rateLimitOverrides);
    if (result.rejected.length > 0) {
      throw new Error(
        `Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(", ")}`
      );
    }
    connection.rateLimitOverrides = result.sanitized;
  }

  _insertConnectionRow(db, encryptConnectionFields({ ...connection }));
  const providerId = toStringOrNull(data.provider);
  if (providerId) {
    reorderConnections(db, providerId);
  }
  backupDbFile("pre-write");
  invalidateDbCache("connections"); // Bust connections read cache

  return withNullableRateLimitOverrides(
    withNullableQuotaWindowThresholds(
      withNullableMaxConcurrent(cleanNulls(connection), connection),
      connection

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/db/providers.ts:686 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/a78fdc1980c60982. Report an issue: GitHub.