LibreChat/api/server/middleware
Marco Beretta 5f4a07f40b
⚡ perf: Exclude Agent Version History From Default getAgent Reads (#16070)
* ⚡ perf: Exclude Agent Version History From Default `getAgent` Reads

getAgent now defaults its projection to { versions: 0 }; loadAgent/loadAddedAgent
and canAccessAgentFromBody use getAgentWithVersionCount so the version count stays
exact without transferring the unbounded versions array on every chat request.
Callers that need history (v1 update/revert handlers) request it explicitly.

* fix: tighten agent version projection types

* fix: type projected agent version counts

* fix: type default agent projection

* style: format agent projection overload

* fix: expose projected agent return type
2026-09-20 19:27:21 -04:00
..
__tests__ 🌐 fix: Expose Gemini Models to Vertex AI Agents (#15234) 2026-08-27 06:50:23 -04:00
accessResources ⚡ perf: Exclude Agent Version History From Default getAgent Reads (#16070) 2026-09-20 19:27:21 -04:00
assistants 🔣 refactor: Replace Mongo Filters With Typed Criteria (#15580) 2026-09-04 11:54:21 -04:00
config ⚙️ perf: reduce first-load MongoDB round trips (#14101) 2026-07-06 09:36:34 -04:00
limiters 🗯️ fix: Give Failed Turns Actionable Guidance (#15896) 2026-09-14 10:37:22 -04:00
roles 🪢 feat: show Langfuse session link in shared chats (#15273) 2026-08-27 14:29:57 -04:00
spec 🔣 refactor: Replace Mongo Filters With Typed Criteria (#15580) 2026-09-04 11:54:21 -04:00
validate ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
abortMiddleware.js 💰 fix: Bill Stopped Agent Turns From Provider Usage (#15889) 2026-09-13 21:51:05 -04:00
abortMiddleware.spec.js 💰 fix: Bill Stopped Agent Turns From Provider Usage (#15889) 2026-09-13 21:51:05 -04:00
abortRun.js 🧾 fix: Honor Disabled Transactions on the Assistants Usage Path (#15100) 2026-08-25 08:30:12 -04:00
buildEndpointOption.js 🖇️ fix: Bind Model-Spec Authorization to the Loaded Agent (#15256) 2026-08-26 10:38:20 -04:00
buildEndpointOption.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
canAccessSharedLink.js 🔗 feat: Add Granular Access Control to Shared Links via ACL System (#13051) 2026-06-03 14:17:17 -04:00
canDeleteAccount.js
canDeleteAccount.spec.js
checkBan.js 🔑 fix: Stringify Ban Cache Keys When Redis Is Off (#16039) 2026-09-19 15:52:06 -04:00
checkBan.spec.js 🔑 fix: Stringify Ban Cache Keys When Redis Is Off (#16039) 2026-09-19 15:52:06 -04:00
checkDomainAllowed.js ⚙️ perf: reduce first-load MongoDB round trips (#14101) 2026-07-06 09:36:34 -04:00
checkInviteUser.js 📮 fix: Consume an Invite Only Once the Account Exists (#15611) 2026-09-04 15:38:32 -04:00
checkInviteUser.spec.js 📮 fix: Consume an Invite Only Once the Account Exists (#15611) 2026-09-04 15:38:32 -04:00
checkPeoplePickerAccess.js 🫂 fix: Scope People Picker Searches to Permitted Types (#15878) 2026-09-13 02:48:27 -04:00
checkSharePublicAccess.js 🗝️ fix: Enforce Skill Share Role Permission (#13062) 2026-05-11 09:39:58 -04:00
checkSharePublicAccess.spec.js 🗝️ fix: Enforce Skill Share Role Permission (#13062) 2026-05-11 09:39:58 -04:00
denyRequest.js ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
error.js ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
index.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
logHeaders.js
messageValidation.js ⚡ perf: Optimize First Load of Large Conversations (#14901) 2026-08-16 19:45:21 -04:00
moderateText.js 🧢 fix: Cap Batched HITL Answers Before PII and Moderation (#15257) 2026-08-26 10:10:19 -04:00
moderateText.spec.js 🧢 fix: Cap Batched HITL Answers Before PII and Moderation (#15257) 2026-08-26 10:10:19 -04:00
noIndex.js
oauthNavigation.js 🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON (#15440) 2026-08-31 21:13:47 -04:00
optionalJwtAuth.js 🔐 feat: Mint Code API Auth Tokens (#13028) 2026-05-09 16:09:10 -04:00
optionalShareFileAuth.js 🍪 fix: Validate Shared-File Cookie Auth Against the Live Refresh Session (#13908) 2026-06-23 08:32:28 -04:00
optionalShareFileAuth.spec.js 🍪 fix: Validate Shared-File Cookie Auth Against the Live Refresh Session (#13908) 2026-06-23 08:32:28 -04:00
requireJwtAuth.js 📬 feat: Add Durable Agent Trigger Delivery (#14925) 2026-08-17 09:25:08 -04:00
requireLdapAuth.js
requireLocalAuth.js
requireSameOrigin.js 🧿 fix: Bind Login Flows to the Browser That Started Them (#15880) 2026-09-13 11:47:29 -04:00
setHeaders.js
setTwoFactorTempUser.js 🚦 fix: Guard Auth Continuation with Dedicated Limiter (#13555) 2026-06-06 14:21:28 -04:00
uaParser.js
validateEmailLogin.js 💂 fix: Enforce ALLOW_EMAIL_LOGIN on the Backend Login Route (#14180) 2026-07-09 09:55:36 -04:00
validateImageRequest.js 🎟️ refactor: Require Credentials for Local Image Access by Default (#15252) 2026-08-27 09:55:27 -04:00
validateMessageReq.js ⚙️ perf: reduce first-load MongoDB round trips (#14101) 2026-07-06 09:36:34 -04:00
validateModel.js 🌐 fix: Expose Gemini Models to Vertex AI Agents (#15234) 2026-08-27 06:50:23 -04:00
validatePasswordReset.js
validateRegistration.js