mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 06:42:12 +03:00
Round-robin combo members deep-queued under concurrency saturation: the per-model rate-limit semaphore had an unbounded queue and only emitted SEMAPHORE_TIMEOUT after the full queueTimeoutMs (default 30s), so failover to the next combo member happened far too late (or the client died first). The per-model semaphore now accepts a bounded queue depth and rejects with SEMAPHORE_QUEUE_FULL once the queue is full — the round-robin loop already cascades to the next member on that code, so a low depth fails over immediately. A new `queueDepth` combo-config knob (global default / provider override / per-combo; default 20 for backward compatibility, 0 = never queue) is plumbed via a resolveComboQueueDepth helper and surfaced in Settings → Combo Defaults. TDD: rateLimitSemaphore.test.ts (bounded queue + SEMAPHORE_QUEUE_FULL, RED before the maxQueueSize cap) and combo-config.test.ts (queueDepth cascade, helper clamps, schema range). Co-authored-by: KooshaPari <KooshaPari@users.noreply.github.com>