mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
refactor: Prevent memory leaks by nullifying boundModel.client in disposeClient function
This commit is contained in:
parent
59818c77ba
commit
a326c18b74
2 changed files with 5 additions and 0 deletions
|
|
@ -238,6 +238,9 @@ function disposeClient(client) {
|
||||||
client.run.Graph.streamBuffer = null;
|
client.run.Graph.streamBuffer = null;
|
||||||
client.run.Graph.clientOptions = null;
|
client.run.Graph.clientOptions = null;
|
||||||
client.run.Graph.graphState = null;
|
client.run.Graph.graphState = null;
|
||||||
|
if (client.run.Graph.boundModel?.client) {
|
||||||
|
client.run.Graph.boundModel.client = null;
|
||||||
|
}
|
||||||
client.run.Graph.boundModel = null;
|
client.run.Graph.boundModel = null;
|
||||||
client.run.Graph.systemMessage = null;
|
client.run.Graph.systemMessage = null;
|
||||||
client.run.Graph.reasoningKey = null;
|
client.run.Graph.reasoningKey = null;
|
||||||
|
|
|
||||||
|
|
@ -787,6 +787,8 @@ class AgentClient extends BaseClient {
|
||||||
[Callback.TOOL_ERROR]: logToolError,
|
[Callback.TOOL_ERROR]: logToolError,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
config.signal = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
await runAgent(this.options.agent, initialMessages);
|
await runAgent(this.options.agent, initialMessages);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue