From 4d2e90a455ff0bd33f4369bfa7aee48f98aaa99d Mon Sep 17 00:00:00 2001 From: Ayush Maniar Date: Thu, 27 Mar 2025 00:10:46 -0700 Subject: [PATCH] Added timeout for history saving --- src/agent/agent.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agent/agent.js b/src/agent/agent.js index bfa9c53..acd947b 100644 --- a/src/agent/agent.js +++ b/src/agent/agent.js @@ -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(); }