⚙️ perf: reduce first-load MongoDB round trips (#14101)

* perf(api): reduce first-load database round trips

* docs: move agent guidance to claude docs

* refactor(api): move message validation into api package

* fix(api): narrow active generation job lookup

* fix(api): preserve omitted source identity
This commit is contained in:
Ravi Kumar L 2026-07-06 15:36:34 +02:00 • committed by GitHub
parent a0aa1f2b9d
commit 44d1275f36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 895 additions and 242 deletions

View file

@ -40,6 +40,16 @@ jest.mock('@librechat/api', () => ({
},
normalizeHttpError: jest.fn((error) => error),
extractWebSearchEnvVars: jest.fn((params) => params.keys),
getAppConfigOptionsFromUser: jest.fn((user) => {
const hasSourceIdentity =
user != null && Object.prototype.hasOwnProperty.call(user, 'idOnTheSource');
return {
role: user?.role,
userId: user?.id,
idOnTheSource: user?.id && hasSourceIdentity ? (user.idOnTheSource ?? null) : undefined,
tenantId: user?.tenantId,
};
}),
needsRefresh: jest.fn(),
getNewS3URL: jest.fn(),
}));