v0.5.2
Bug-fix release: on self-hosted PG deployments the provider-limits
(balance/quota) cache froze, sync 500'd, and the dashboard read an empty
map even though rows were present in Postgres. Also fixes a 503 admission
regression from tight heavy-request limits.
Fixed
- Cloud-detection short-circuit: the probe (
typeof globalThis.caches === "object") fired on every standalone server because Next 16 polyfills the
Web Cache API, making balance/limit cache reads return empty and writes
silently no-op. Cloud semantics now require the edge runtime
(NEXT_RUNTIME=nodejsexcluded) or explicitOMNIROUTE_CLOUD=true. - SiliconFlow balance guard: the
/v1/user/infopayload now reports a
degenerate all-string-zero shape as unavailable instead of a genuine 0
balance. INSERT OR REPLACEupsert broke under webpack module duplication: the
Postgres adapter (and its module-scoped pk-cache) is bundled into several
chunks, each holding its own copy; a route served through a different chunk
held a cold pk-cache and degraded toON CONFLICT DO NOTHING, so
already-cached connections never updated. Each adapter now warms its pk-cache
lazily on first use and re-translates to a realON CONFLICT (...) DO UPDATE.- Named-placeholder regression: the adapter rework dropped the SQL rewrite
mapping named SQLite placeholders (@name/:name) to positional$N, so
queries likeis_active = @isActivehit Postgres withcolumn "isactive" does not existand provider-limits sync returned 500.buildBindernow
returns both the positional SQL and the binder. - Read path surfaced an empty map:
getSanitizedCachedProviderLimitsMap
consumedawait getAllProviderLimitsCache()synchronously (noawait), so
Object.keys(caches)ran against a Promise and the map degraded to{}
even though rows were present in Postgres. - Admission lease TTL: the chat heavyweight admission lease is now
force-released after a configurable TTL
(OMNIROUTE_CHAT_HEAVY_LEASE_TTL_MS, default 10 min) as a defensive
backstop against a stuck upstream SSE stream permanently occupying one of
the heavy in-flight slots, which would otherwise push legitimate concurrent
heavy traffic into retryable 503s (chat_admission_busy).
Full Changelog: v0.5.1...v0.5.2