diff --git a/.env.example b/.env.example index d6eb181ffb..60b5074e6e 100644 --- a/.env.example +++ b/.env.example @@ -84,6 +84,10 @@ PORT=20128 # API_HOST=0.0.0.0 # DASHBOARD_PORT=20128 +# Connection backpressure: cap concurrent in-flight chat connections (503 + Retry-After when full). +# Used by: src/sse/utils/backpressure.ts — disabled when unset/0. +# OMNI_MAX_CONCURRENT_CONNECTIONS=0 + # Port for the real-time WebSocket live monitoring server. # Used by: src/server/ws/liveServer.ts, src/app/api/v1/ws/route.ts # Default: 20132 @@ -2106,24 +2110,24 @@ QUOTA_STORE_DRIVER=sqlite # sqlite | redis # BIFROST_API_KEY= # BIFROST_STREAMING_ENABLED=true # BIFROST_TIMEOUT_MS=30000 - -# ───────────────────────────────────────────────────────────────────────────── -# Account rotation config (operator-managed; consumed by open-sse/services/rotationConfig.ts) -# Lets a supervising front-end mirror its rotation rules onto the backend's account-fallback -# engine. All optional; defaults preserve the historical behavior. -# ───────────────────────────────────────────────────────────────────────────── -# OMNIROUTE_ROTATION_ENABLED=true -# OMNIROUTE_ROTATION_RATE_LIMIT_RESET_SECONDS=0 -# OMNIROUTE_ROTATION_DISABLE_TAG_WITHOUT_RESET=true -# OMNIROUTE_ROTATE_ON_429=true -# OMNIROUTE_ROTATE_429_THRESHOLD=1 -# OMNIROUTE_ROTATE_429_WINDOW_SECONDS=120 -# OMNIROUTE_ROTATE_ON_500=true -# OMNIROUTE_ROTATE_500_THRESHOLD=1 -# OMNIROUTE_ROTATE_500_WINDOW_SECONDS=120 -# OMNIROUTE_ROTATE_ON_502=true -# OMNIROUTE_ROTATE_502_THRESHOLD=1 -# OMNIROUTE_ROTATE_502_WINDOW_SECONDS=120 -# OMNIROUTE_ROTATE_ON_400=false -# OMNIROUTE_ROTATE_400_THRESHOLD=1 -# OMNIROUTE_ROTATE_400_WINDOW_SECONDS=120 + +# ───────────────────────────────────────────────────────────────────────────── +# Account rotation config (operator-managed; consumed by open-sse/services/rotationConfig.ts) +# Lets a supervising front-end mirror its rotation rules onto the backend's account-fallback +# engine. All optional; defaults preserve the historical behavior. +# ───────────────────────────────────────────────────────────────────────────── +# OMNIROUTE_ROTATION_ENABLED=true +# OMNIROUTE_ROTATION_RATE_LIMIT_RESET_SECONDS=0 +# OMNIROUTE_ROTATION_DISABLE_TAG_WITHOUT_RESET=true +# OMNIROUTE_ROTATE_ON_429=true +# OMNIROUTE_ROTATE_429_THRESHOLD=1 +# OMNIROUTE_ROTATE_429_WINDOW_SECONDS=120 +# OMNIROUTE_ROTATE_ON_500=true +# OMNIROUTE_ROTATE_500_THRESHOLD=1 +# OMNIROUTE_ROTATE_500_WINDOW_SECONDS=120 +# OMNIROUTE_ROTATE_ON_502=true +# OMNIROUTE_ROTATE_502_THRESHOLD=1 +# OMNIROUTE_ROTATE_502_WINDOW_SECONDS=120 +# OMNIROUTE_ROTATE_ON_400=false +# OMNIROUTE_ROTATE_400_THRESHOLD=1 +# OMNIROUTE_ROTATE_400_WINDOW_SECONDS=120 diff --git a/changelog.d/maintenance/basereds-mechanical-2026-07-12.md b/changelog.d/maintenance/basereds-mechanical-2026-07-12.md new file mode 100644 index 0000000000..f1ee83c06f --- /dev/null +++ b/changelog.d/maintenance/basereds-mechanical-2026-07-12.md @@ -0,0 +1 @@ +- chore(base): re-export relayProbeStats from localDb (db-rules gate, #6909 follow-up) and document OMNI_MAX_CONCURRENT_CONNECTIONS in .env.example/ENVIRONMENT.md (env-doc gate, #6590 follow-up) diff --git a/docs/reference/ENVIRONMENT.md b/docs/reference/ENVIRONMENT.md index f6de10034b..bd8fe06946 100644 --- a/docs/reference/ENVIRONMENT.md +++ b/docs/reference/ENVIRONMENT.md @@ -122,6 +122,7 @@ OmniRoute uses **SQLite** (via `better-sqlite3`) for all persistence. These vari | `API_PORT` | _(unset)_ | `src/lib/runtime/ports.ts` | When set, serves the `/v1/*` proxy API on this separate port. | | `API_HOST` | `0.0.0.0` | `src/lib/runtime/ports.ts` | Bind address for the API port. | | `DASHBOARD_PORT` | _(unset)_ | `src/lib/runtime/ports.ts` | When set, serves the Dashboard UI on this separate port. | +| `OMNI_MAX_CONCURRENT_CONNECTIONS` | `0` _(disabled)_ | `src/sse/utils/backpressure.ts` | Caps concurrent in-flight chat connections; requests over the cap get `503` with `Retry-After`. Positive integer enables the guard; unset/`0` disables it. | | `PROD_DASHBOARD_PORT` | `20130` | `docker-compose.prod.yml` | Host-side published port for the Dashboard in Docker production mode. | | `PROD_API_PORT` | `20131` | `docker-compose.prod.yml` | Host-side published port for the API in Docker production mode. | | `OMNIROUTE_PORT` | _(unset)_ | `src/lib/runtime/ports.ts` | Takes precedence over `PORT` when running inside Electron or other wrappers. | diff --git a/src/lib/localDb.ts b/src/lib/localDb.ts index 5cc8b6a76e..46f2eb67cf 100755 --- a/src/lib/localDb.ts +++ b/src/lib/localDb.ts @@ -801,3 +801,4 @@ export { markConnectionRateLimitedUntil, clearConnectionRateLimit } from "./db/p // Provider param filters — denylist/allowlist config per provider/model (#6625) export * from "./db/paramFilters"; export * from "./db/interceptionRules"; // Per-model web-search/web-fetch interception rules (#3384) +export * from "./db/relayProbeStats"; // Relay probe latency/health stats (#6909)