mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-03 17:18:51 +01:00
🔧 fix: Keyv and Proxy Issues, and More Memory Optimizations (#6867)
* chore: update @librechat/agents dependency to version 2.4.15
* refactor: Prevent memory leaks by nullifying boundModel.client in disposeClient function
* fix: use of proxy, use undici
* chore: update @librechat/agents dependency to version 2.4.16
* Revert "fix: use of proxy, use undici"
This reverts commit 83153cd582.
* fix: ensure fetch is imported for HTTP requests
* fix: replace direct OpenAI import with CustomOpenAIClient from @librechat/agents
* fix: update keyv peer dependency to version 5.3.2
* fix: update keyv dependency to version 5.3.2
* refactor: replace KeyvMongo with custom implementation and update flow state manager usage
* fix: update @librechat/agents dependency to version 2.4.17
* ci: update OpenAIClient tests to use CustomOpenAIClient from @librechat/agents
* refactor: remove KeyvMongo mock and related dependencies
This commit is contained in:
parent
339882eea4
commit
64bd373bc8
18 changed files with 375 additions and 743 deletions
|
|
@ -1,48 +0,0 @@
|
|||
jest.mock('@keyv/mongo', () => {
|
||||
const EventEmitter = require('events');
|
||||
class KeyvMongo extends EventEmitter {
|
||||
constructor(url = 'mongodb://127.0.0.1:27017', options) {
|
||||
super();
|
||||
this.ttlSupport = false;
|
||||
url = url ?? {};
|
||||
if (typeof url === 'string') {
|
||||
url = { url };
|
||||
}
|
||||
if (url.uri) {
|
||||
url = { url: url.uri, ...url };
|
||||
}
|
||||
this.opts = {
|
||||
url,
|
||||
collection: 'keyv',
|
||||
...url,
|
||||
...options,
|
||||
};
|
||||
|
||||
// In-memory store for tests
|
||||
this.store = new Map();
|
||||
}
|
||||
|
||||
async get(key) {
|
||||
return this.store.get(key);
|
||||
}
|
||||
|
||||
async set(key, value, ttl) {
|
||||
this.store.set(key, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
async delete(key) {
|
||||
return this.store.delete(key);
|
||||
}
|
||||
|
||||
async clear() {
|
||||
this.store.clear();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Create a store factory function for the test suite
|
||||
const store = () => new KeyvMongo();
|
||||
|
||||
return { KeyvMongo };
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue