Added timeout for history saving

This commit is contained in:
Ayush Maniar 2025-03-27 00:10:46 -07:00
parent 7afaba99a4
commit 4d2e90a455

View file

@ -485,6 +485,7 @@ export class Agent {
if (res) {
await this.history.add('system', `Task ended with score : ${res.score}`);
await this.history.save();
await new Promise(resolve => setTimeout(resolve, 3000)); // Wait 3 second for save to complete
console.log('Task finished:', res.message);
this.killAll();
}