From 09595d2f3bda7834362835e3c8f1b4b6203a9d60 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Sun, 11 May 2025 16:43:08 -0700 Subject: [PATCH] fixing small task timeout bug --- src/agent/tasks/tasks.js | 19 +------------------ .../human_ai/2_agent_1_human.json | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/agent/tasks/tasks.js b/src/agent/tasks/tasks.js index 32f24dc..0a740ab 100644 --- a/src/agent/tasks/tasks.js +++ b/src/agent/tasks/tasks.js @@ -240,7 +240,7 @@ export class Task { this.taskStartTime = taskStartTime; else this.taskStartTime = Date.now(); - + console.log("Task start time set to", this.taskStartTime); this.validator = null; this.reset_function = null; this.blocked_actions = []; @@ -264,7 +264,6 @@ export class Task { this.conversation = this.data.conversation; } this.taskTimeout = this.data.timeout || 300; - this.taskStartTime = Date.now(); // Set validator based on task_type if (this.task_type === 'construction') { @@ -440,21 +439,6 @@ export class Task { console.log("Setting inventory..."); let initialInventory = {}; - // Handle multi-agent inventory assignment - // function hasSubDictionary(obj) { - // for (let key in obj) { - // if (typeof obj[key] === 'object' && obj[key] !== null) { - // return true; - // } - // } - // return false; - // } - - // const hasSubDictionaryResult = hasSubDictionary(this.data.initial_inventory); - // const firstKey = Object.keys(initialInventory)[0]; - // console.log(firstKey); - // console.log(hasSubDictionaryResult); - // if (typeof this.data.initial_inventory[firstKey] === 'object') { initialInventory = this.data.initial_inventory[this.agent.count_id.toString()] || {}; console.log("Initial inventory for agent", this.agent.count_id, ":", initialInventory); console.log("") @@ -466,7 +450,6 @@ export class Task { throw new Error(`Number of human players ${this.human_count} does not match the number of usernames provided. ${this.data.usernames.length}`); return; } - const starting_idx = this.data.agent_count; for (let i = 0; i < this.data.human_count; i++) { diff --git a/tasks/construction_tasks/human_ai/2_agent_1_human.json b/tasks/construction_tasks/human_ai/2_agent_1_human.json index da95ae6..29d5253 100644 --- a/tasks/construction_tasks/human_ai/2_agent_1_human.json +++ b/tasks/construction_tasks/human_ai/2_agent_1_human.json @@ -3,7 +3,7 @@ "type": "construction", "goal": "Make a structure with the blueprint below", "conversation": "Let's share materials and make a structure with the blueprint", - "agent_count": 1, + "agent_count": 2, "human_count": 1, "timeout": 600, "blueprint": {