Docker images launched without a sibling Redis container used to spam
'[REDIS] Error: connect ECONNREFUSED 127.0.0.1:6379' for every
rate-limit and API-key-auth cache lookup. The root cause was a default
of process.env.REDIS_URL || 'redis://localhost:6379' that turned the
opt-in cache into a hard dependency.
Three coordinated changes:
1. src/shared/utils/rateLimiter.ts — gate Redis on REDIS_URL being
explicitly set. getRedisClient() returns null when disabled; the
single connection-error handler dedupes via a redisErrorLogged latch
so a sustained outage produces one warn instead of per-request flood.
checkRateLimit() routes to the existing in-memory store on both the
'disabled' and 'test' paths.
2. src/lib/db/apiKeys.ts — short-circuit Redis-backed auth cache reads
and writes when getRedisClient() returns null. SQLite remains
authoritative; the cache is purely an optimization.
3. Same file — replace the wildcard scope matcher's dynamic RegExp
compilation with a deterministic segment walker. Eliminates the
ReDoS surface on operator-supplied scope patterns and silences the
Semgrep js/regex-injection advisory that previously blocked edits to
this file.
Single-instance deployments now work silently out of the box;
multi-instance setups continue to use Redis when REDIS_URL is set.
Combo dispatch and the combo test button used to crash with
'TypeError: e.startsWith is not a function' when a step's modelStr
failed to resolve (regression after #2338 added per-account LKGP
routing for local/Docker providers). The TypeScript annotation says
the field is always a string, but malformed combo rows leaked through
to the dispatch path.
Two defensive boundary guards:
1. open-sse/services/combo.ts LKGP fallback findIndex — type-check
target.modelStr before calling startsWith.
2. src/app/api/combos/test/route.ts testComboTarget — coerce
target.modelStr at the entry, surface a clean 'Combo step is
missing a model id' error instead of crashing.
Regression test parses the source and asserts no unguarded
target.modelStr.<string-method> usages remain in combo.ts, so a
future refactor that reintroduces the pattern fails loudly.
Two related provider-registry fixes:
#2361: LLM7.io was visible in the dashboard provider catalog (entry in
src/shared/constants/providers.ts) but the executor registry in
open-sse/config/providerRegistry.ts had no llm7 entry. Every connection
test fell through with a credential error because there was no baseUrl
or authType configured. Added the standard OpenAI-compatible v1
endpoint with a small seed model catalogue.
#2360: Cohere was pointed at the native /v2/chat upstream which returns
the proprietary { message: { content: [{type:'text', text:...}] } }
shape. The combo test validator (extractComboTestResponseText) only
reads the OpenAI choices[] envelope, so a successful Cohere call
surfaced as 'Provider returned HTTP 200 but no text content.' Cohere
publishes an OpenAI-compatible compatibility layer at
/compatibility/v1 that returns { choices: [{ message: { content }}] }
so we route there instead of needing a Cohere-specific translator.
Regression test asserts both registry entries match the expected
shape so a future refactor that reverts the URLs fails loudly.
The native claude OAuth path (base.ts:794 applySystemTransformPipeline)
early-exited because DEFAULT_SYSTEM_TRANSFORMS_CONFIG.providers[claude]
was {enabled:false, pipeline:[]}. Result: third-party-agent fingerprints
(github.com/anomalyco/opencode, 'You are OpenCode', 'Here is some useful
information about the environment...') leaked into /v1/messages system
blocks, triggering Anthropic billing-gate:
[400] Third-party apps now draw from extra usage, not plan limits.
Mirror the cc-bridge defaults:
- DEFAULT_PARAGRAPH_REMOVAL_ANCHORS + OPENWEBUI_PARAGRAPH_ANCHORS
- DEFAULT_IDENTITY_PREFIXES + OPENWEBUI_IDENTITY_PREFIXES
- DEFAULT_TEXT_REPLACEMENTS as replace_text ops (allOccurrences:true)
- obfuscate_words
Omit prepend_system_block + inject_billing_header — base.ts:759-784
already handles those on the native claude OAuth path.
UI mirror RoutingTab.tsx and snapshot in system-transforms.test.ts
updated for parity. 56/56 transform-related tests pass.
Verified end-to-end 2026-05-18 after npm run build:cli + restart:
- request v8tq04 -> 200 in 1.84s
- request shape {max_tokens:32000, reasoning_effort:high} -> 200 in 1.99s
- x-omniroute-provider=cc (claude-code OAuth pool, account 62875e01)
- telemetry: [SystemTransforms] claude-native: drop_paragraph_if_contains,
drop_paragraph_if_starts_with, replace_text, replace_text, obfuscate_words
When the shared <Tooltip> appeared inside a modal (combo editor) or any
ancestor with overflow:hidden/auto, long labels were clipped — the
absolute-positioned <span> stayed inside the modal's stacking context.
Render the tooltip via createPortal to document.body by default
(usePortal prop, defaults to true). Coordinates are computed from the
trigger's getBoundingClientRect on each show and written directly to
the tooltip ref's .style — that avoids the cascading-render warning
that setState-inside-effect triggers, while still doing one synchronous
measure-and-position pass before the user sees any flicker.
Coordinates are clamped to the viewport bounds so a trigger near the
right edge produces a tooltip that stays on-screen instead of bleeding
off. Adds an optional multiline prop that swaps the legacy
whitespace-nowrap clamp for max-w-xs whitespace-normal break-words for
explanation strings (combo strategy help, etc.).
Backward compat: existing call sites do not need to change; the portal
+ clamp behavior is transparent to consumers.
Adds a deterministic test for the rawEffort resolution chain in
open-sse/executors/codex.ts so a future refactor that flips the priority
back (the bug we just fixed) trips an explicit assertion. Also verifies
end-to-end behavior of the priority order: modelEffort > explicitReasoning
> requestReasoningEffort > fallbackReasoningEffort.
The source fix itself landed earlier on this branch; this commit only
adds the test coverage.
Claude Code Pro/Team users hit a 429 cascade where every Claude account
got marked rate-limited for only a few seconds, retried, hit 429 again,
and the cycle exhausted all accounts until the 5h subscription window
finally reset. Root cause: Anthropic OAuth 429 bodies carry phrases like
'Usage Limit Reached' or 'Claude Pro usage limit reached' that don't
contain the word 'quota'. classifyErrorText fell through to
RATE_LIMIT_EXCEEDED with the OAuth ~5s base cooldown.
Three targeted changes in open-sse/services/accountFallback.ts:
1. classifyErrorText: recognize the Anthropic OAuth phrases ('usage limit
reached', 'claude pro usage limit', 'you've reached your usage limit'
and variants) and return QUOTA_EXHAUSTED.
2. checkFallbackError: new branch that, when the classifier flags
QUOTA_EXHAUSTED for a non-credits/non-daily case, applies a deliberate
1h cooldown (subscription quotas need real time to reset; the existing
COOLDOWN_MS.paymentRequired is only 2 minutes).
3. parseRetryFromErrorText: parse absolute ISO 8601 timestamps in the
body ('Try again at 2026-05-17T10:00:00Z', 'Please wait until ...').
When present, honor the upstream's stated recovery time instead of
the 1h default.
Cross-provider fallback for direct (non-combo) calls remains a separate
feature — operators wanting that should route Claude through a combo
that includes openrouter/claude or another fallback target.
`validateResponseQuality` flagged any response with `content: null` as
empty and triggered a false-positive 502 combo fallback, even when the
upstream returned the entire answer in `reasoning_content`. This
affected every reasoning model that omits `content` by design:
moonshotai/Kimi-K2.5-TEE, zai-org/GLM-5-TEE, zai-org/GLM-4.7-TEE,
DeepSeek-R1 and Qwen-thinking variants via Chutes.ai, Nvidia, and other
OpenAI-compatible gateways.
Treat a non-empty `reasoning_content` (or its legacy `reasoning` alias)
as valid content. Empty/whitespace-only strings still fall through to
the existing empty-content rejection so we don't weaken the guard.
Backward compat verified: regular content-only and tool_calls-only
responses still validate without change.
`.dockerignore` excluded everything under `docs/` except `openapi.yaml`,
which broke the in-product Docs viewer at `/docs/*` with "ENOENT: no
such file or directory, open '/app/docs/SETUP_GUIDE.md'" for every help
page. The previous block-list was meant to keep the image small but it
hid the ~5 MB English markdown tree that the viewer actually reads.
Replace the block with a targeted exclude of the heavy assets that
account for ~45 MB of the original ~50 MB:
- docs/i18n/** (translated copies — viewer falls back to English)
- docs/screenshots/**
- docs/diagrams/exported/** plus raster/SVG variants
Note: Go filepath.Match (Docker's matcher) treats `*` as not crossing
`/`, so the existing `*.md` rule still excludes only root-level
markdown — nested `docs/**/*.md` is implicitly kept without a
re-include rule that would have brought i18n back.
Added a regression test that parses .dockerignore and asserts the
critical English docs survive the filter while the heavy paths still
do not.
The auto-routing path in src/sse/handlers/chat.ts called `getSettings()`
on every `auto` / `auto/\*` request, but the symbol was never imported in
this module (only `getCachedSettings` was). The runtime ReferenceError
crashed the request with a 500 before any routing could happen.
Replace the call with `getCachedSettings` (already imported, identical
return shape, plus the cached variant benefits the auto-routing hot path).
A regression-guard test scans chat.ts to fail loudly if a future refactor
re-introduces the unimported call pattern.