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
Same refusal pattern as quotaWindowThresholds, applied to rateLimitOverrides in createProviderConnection: the sanitizer rejected keys in the override map (unknown field names or invalid values), so persistence is blocked with the rejected keys named instead of storing a partial/invalid override set.
Solutions
- Correct or drop the rejected override keys named in the error
- Only submit override fields defined by the rate-limit override schema
- Validate overrides client-side before calling the connection creation API
Defensive patterns
Strategy: validation
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.
Appendix: 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),
connectionView on GitHub (pinned to a179ffed5b)