🧠 fix: Prevent Memory Errors with Buffer String (#8196)

This commit is contained in:
Danny Avila 2025-07-02 10:25:19 -04:00 committed by GitHub
parent 8ba61a86f4
commit 07e08143e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -525,7 +525,10 @@ class AgentClient extends BaseClient {
messagesToProcess = [...messages.slice(-messageWindowSize)];
}
}
return await this.processMemory(messagesToProcess);
const bufferString = getBufferString(messagesToProcess);
const bufferMessage = new HumanMessage(`# Current Chat:\n\n${bufferString}`);
return await this.processMemory([bufferMessage]);
} catch (error) {
logger.error('Memory Agent failed to process memory', error);
}