mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 12:52:11 +03:00
When all provider quotas are exhausted (reservoir=0 after repeated 429s), Bottleneck's schedule() would queue requests indefinitely since no maxWait was configured. Clients (Cursor, Claude Code, VS Code) would hang forever. Fix: add maxWait=120000 (2min, configurable via RATE_LIMIT_MAX_WAIT_MS env) to DEFAULT_SETTINGS and all three Bottleneck constructors. When a job waits longer than maxWait, Bottleneck rejects with a BottleneckError which propagates as a 502/503 error to the client — a clean fail-fast instead of infinite hang.