mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-06-21 21:08:11 +00:00
`resolveSummarizationProvider` calls `getProviderConfig` to translate the agent's resolved provider into an initializer + client overrides. Three real-world inputs were unsupported and fell through to "raw provider" fallback (silently dropping client overrides): 1. **`vertexai`** — not in `providerConfigMap` at all. Vertex shares initialization with Google (auth-only runtime distinction). Map `Providers.VERTEXAI` to `initializeGoogle`. 2. **`openrouter` (and other known custom providers) with CamelCase custom endpoint names** — agent main flow looks up endpoints case-sensitively (case-preserving keys are how `loadCustomEndpointsConfig` lets users have distinct entries differing only in case). Once it succeeds, `agent.provider` is normalized to lowercase. Downstream resolvers re-enter `getProviderConfig` with the lowercased value and miss configs whose `name` is camel-cased. Add a case-insensitive fallback, narrowly scoped to known custom providers and only after the case-sensitive direct lookup fails. 3. **Ambiguous case-insensitive matches (codex review feedback)** — if the user has e.g. `OpenRouter` and `OPENROUTER` (neither lowercase) and the agent runtime passes `openrouter`, the case-insensitive fallback could silently route to whichever entry appears first in the array (potentially different baseURL/apiKey). Detect multiple case-insensitive matches and throw a clear error with both names rather than picking arbitrarily. ## Tests `providers.spec.ts` — new file, 7 tests: - vertexai → Google initializer - google (API key) → Google initializer (regression guard) - case-insensitive fallback when only CamelCase entry exists - exact-case match preserved when both casings exist (case identity) - exact-case lowercase entry still resolves - throws on ambiguous case-insensitive matches when no exact-case exists - still throws when no match at all |
||
|---|---|---|
| .. | ||
| acl | ||
| admin | ||
| agents | ||
| apiKeys | ||
| app | ||
| auth | ||
| cache | ||
| cdn | ||
| cluster | ||
| crypto | ||
| db | ||
| endpoints | ||
| files | ||
| flow | ||
| mcp | ||
| memory | ||
| middleware | ||
| oauth | ||
| prompts | ||
| skills | ||
| storage | ||
| stream | ||
| tools | ||
| types | ||
| utils | ||
| web | ||
| index.ts | ||