LibreChat/packages/data-provider/src
Dustin Healy 0d5c2b339a
🛟 fix: Allow Empty modelSpecs.list to Unstick Admin-Panel Saves (#13036)
* 🛟 fix: Allow empty modelSpecs.list to unstick admin-panel saves

The unconditional `.min(1)` on `specsConfigSchema.list` rejected an empty
list even when `enforce: false`, leaving admin panels (which save fields
path-granularly) with no atomic way to clear the list once it had been
populated. Once an admin reached `list: [entry]` and deleted the only
entry, every subsequent save failed schema validation and the section
became stuck.

Relax the schema to `.default([])`. The `.min(1)` was added in #5218 as
part of bundled cleanup, not as a deliberate rule. Every consumer of
`modelSpecs.list` already handles the empty/undefined case (`?.list`,
`?? []`, length-checked), and `processModelSpecs` short-circuits to
`undefined` when the list is empty so the runtime treats it as "no
specs configured." No call site is load-bearing on length >= 1.

Tighten the `buildEndpointOption.js` enforce guard from
`?.list && ?.enforce` to `?.list?.length && ?.enforce`. Empty arrays
are truthy in JS, so the existing guard would have entered the enforce
branch on `list: []` and returned "No model spec selected" or "Invalid
model spec" had `processModelSpecs` ever been bypassed.

Add a runtime warn in `processModelSpecs` when `enforce: true` is
configured alongside an empty list, so operators see the resulting
"enforcement disabled" state in logs rather than silently getting a
permissive runtime.

Add coverage for the empty-list parse path in `config-schemas.spec.ts`
and for the empty-list-with-enforce branch in `buildEndpointOption.spec.js`.

* chore: update import order in config-schemas.spec.ts
2026-05-09 11:39:15 -04:00
..
react-query 🏗️ refactor: Remove Redundant Caching, Migrate Config Services to TypeScript (#12466) 2026-03-30 16:49:48 -04:00
types 🧱 refactor: typed CodeEnvRef + kind discriminator + principal-aware sandbox cache (#12960) 2026-05-08 12:29:43 -04:00
accessPermissions.ts 🧬 feat: Scaffold Skills CRUD with ACL Sharing and File Schema (#12613) 2026-04-25 04:01:59 -04:00
actions.ts
api-endpoints.ts 🚀 feat: Decouple File Attachment Persistence from Preview Rendering (#12957) 2026-05-06 03:04:19 -04:00
artifacts.ts
azure.ts
balance.spec.ts ⏱️ fix: Align Auto-Refill Next Date (#12980) 2026-05-06 21:40:18 -04:00
balance.ts ⏱️ fix: Align Auto-Refill Next Date (#12980) 2026-05-06 21:40:18 -04:00
bedrock.ts 🧵 feat: Enable Anthropic Tool Argument Streaming (#12962) 2026-05-06 01:09:14 -04:00
cloudfront-config.spec.ts 🌥️ feat: Add Optional Region-aware S3/CloudFront Storage Keys (#12987) 2026-05-06 23:16:56 -04:00
codeEnvRef.spec.ts 🧱 refactor: typed CodeEnvRef + kind discriminator + principal-aware sandbox cache (#12960) 2026-05-08 12:29:43 -04:00
codeEnvRef.ts 🧱 refactor: typed CodeEnvRef + kind discriminator + principal-aware sandbox cache (#12960) 2026-05-08 12:29:43 -04:00
config.spec.ts 🛡️ refactor: Scope allowedAddresses By Port (#13022) 2026-05-08 12:28:34 -04:00
config.ts 🛡️ refactor: Scope allowedAddresses By Port (#13022) 2026-05-08 12:28:34 -04:00
createPayload.ts 🎬 feat: Prime Manually-Invoked Skills via $ Popover (#12709) 2026-04-25 04:02:00 -04:00
data-service.ts 🔐 feat: Add Signed CloudFront File Downloads (#12970) 2026-05-06 19:48:30 -04:00
feedback.ts
file-config.spec.ts 📑 fix: Alias Mimetype text/x-markdown to text/markdown (#12608) 2026-04-11 08:23:04 -04:00
file-config.ts 📅 feat: Support text/calendar (iCalendar) in Code Outputs (#12758) 2026-04-22 11:19:10 -04:00
generate.ts
headers-helpers.ts 🚪 fix: Complete OIDC RP-Initiated Logout With id_token_hint and Redirect Race Fix (#12024) 2026-03-02 21:34:13 -05:00
index.ts 🧱 refactor: typed CodeEnvRef + kind discriminator + principal-aware sandbox cache (#12960) 2026-05-08 12:29:43 -04:00
keys.ts 🚀 feat: Decouple File Attachment Persistence from Preview Rendering (#12957) 2026-05-06 03:04:19 -04:00
mcp.ts 🧹 refactor: Tighten Config Schema Typing and Remove Deprecated Fields (#12452) 2026-03-29 01:10:57 -04:00
messages.ts
models.ts 🛟 fix: Allow Empty modelSpecs.list to Unstick Admin-Panel Saves (#13036) 2026-05-09 11:39:15 -04:00
parameterSettings.ts 🫧 feat: Claude Opus 4.7 Reasoning Visibility (#12701) 2026-04-16 21:56:52 -04:00
parsers.ts 📌 fix: Stabilize Agent Prompt Cache Prefix (#12907) 2026-05-02 09:55:31 +09:00
permissions.ts 🧬 feat: Scaffold Skills CRUD with ACL Sharing and File Schema (#12613) 2026-04-25 04:01:59 -04:00
request.ts 🧭 fix: Subdirectory Deployment Auth Redirect Path Doubling (#12077) 2026-03-05 01:38:44 -05:00
roles.spec.ts 🔐 chore: Skills Permissions Housekeeping, Reachable Admin Dialog + Defaults Tests (#12766) 2026-04-25 04:02:01 -04:00
roles.ts 🧬 feat: Scaffold Skills CRUD with ACL Sharing and File Schema (#12613) 2026-04-25 04:01:59 -04:00
schemas.spec.ts 🦉 feat: Claude Opus 4.7 Model Support (#12698) 2026-04-16 14:51:00 -04:00
schemas.ts 🛡️ fix: Strict Opt-In Skills Activation per Agent (#12823) 2026-04-25 04:02:01 -04:00
types.ts ⏱️ fix: Align Auto-Refill Next Date (#12980) 2026-05-06 21:40:18 -04:00
utils.ts 🧯 fix: Prevent Env-Variable Exfil. via Placeholder Injection (#12260) 2026-03-16 08:48:24 -04:00