From c1ce3bf9b6c1712da23f08f4194e927c4b241d8c Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Tue, 11 Mar 2025 10:45:25 -0500 Subject: [PATCH 01/15] fix merge conflict --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index a1b615b..71b1187 100644 --- a/.gitignore +++ b/.gitignore @@ -19,10 +19,5 @@ experiments/ andy_*.json jill_*.json src/models/logs/* -<<<<<<< HEAD -server_data/* -server_data_*/* -======= server_data* results/* ->>>>>>> d70491e5974a973b96c47f0515c2722b82c9b253 From 87d34aa023f7064da700ef03714bce1b2ccae6a5 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Tue, 11 Mar 2025 10:45:55 -0500 Subject: [PATCH 02/15] add blueprint to blocked actions --- settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.js b/settings.js index 2a960fa..e1cf007 100644 --- a/settings.js +++ b/settings.js @@ -13,7 +13,7 @@ export default // the base profile is shared by all bots for default prompts/examples/modes "base_profile": "./profiles/defaults/survival.json", // also see creative.json, god_mode.json "profiles": ((process.env.PROFILES) && JSON.parse(process.env.PROFILES)) || [ - "./profiles/deepseek.json", + "./profiles/andy.json", // "./profiles/gpt.json", // "./profiles/claude.json", // "./profiles/gemini.json", @@ -35,7 +35,7 @@ export default "show_bot_views": false, // show bot's view in browser at localhost:3000, 3001... "allow_insecure_coding": process.env.INSECURE_CODING || false, // allows newAction command and model can write/run code on your computer. enable at own risk - "blocked_actions" : [], // commands to disable and remove from docs. Ex: ["!setMode"] + "blocked_actions" : ["!checkBlueprint", "!checkBlueprintLevel", "!getBlueprint", "!getBlueprintLevel"], // commands to disable and remove from docs "code_timeout_mins": -1, // minutes code is allowed to run. -1 for no timeout "relevant_docs_count": 5, // Parameter: -1 = all, 0 = no references, 5 = five references. If exceeding the maximum, all reference documents are returned. From ce8dd89231443b63628bbb87471c03932db63145 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Tue, 11 Mar 2025 11:03:40 -0500 Subject: [PATCH 03/15] prompter refactor --- settings.js | 2 +- src/models/prompter.js | 114 +++++++++++++++-------------------------- 2 files changed, 42 insertions(+), 74 deletions(-) diff --git a/settings.js b/settings.js index e1cf007..5c16d27 100644 --- a/settings.js +++ b/settings.js @@ -45,5 +45,5 @@ export default "verbose_commands": true, // show full command syntax "narrate_behavior": true, // chat simple automatic actions ('Picking up item!') "chat_bot_messages": true, // publicly chat messages to other bots - "log_all_prompts": false, // log all prompts to console + "log_all_prompts": false, // log all prompts to file } diff --git a/src/models/prompter.js b/src/models/prompter.js index bdcaa4e..1d3b380 100644 --- a/src/models/prompter.js +++ b/src/models/prompter.js @@ -131,6 +131,8 @@ export class Prompter { profile.api = 'google'; else if (profile.model.includes('openrouter/')) profile.api = 'openrouter'; // must do before others bc shares model names + else if (profile.model.includes('vllm/')) + profile.api = 'vllm'; else if (profile.model.includes('gpt') || profile.model.includes('o1')|| profile.model.includes('o3')) profile.api = 'openai'; else if (profile.model.includes('claude')) @@ -304,51 +306,7 @@ export class Prompter { this.last_prompt_time = Date.now(); } - // async promptConvo(messages) { - // this.most_recent_msg_time = Date.now(); - // let current_msg_time = this.most_recent_msg_time; - // for (let i = 0; i < 3; i++) { // try 3 times to avoid hallucinations - // await this.checkCooldown(); - // if (current_msg_time !== this.most_recent_msg_time) { - // return ''; - // } - // let prompt = this.profile.conversing; - // prompt = await this.replaceStrings(prompt, messages, this.convo_examples); - // let generation = await this.chat_model.sendRequest(messages, prompt); - // // in conversations >2 players LLMs tend to hallucinate and role-play as other bots - // // the FROM OTHER BOT tag should never be generated by the LLM - // if (generation.includes('(FROM OTHER BOT)')) { - // console.warn('LLM hallucinated message as another bot. Trying again...'); - // continue; - // } - // if (current_msg_time !== this.most_recent_msg_time) { - // console.warn(this.agent.name + ' received new message while generating, discarding old response.'); - // return ''; - // } - // return generation; - // } - // return ''; - // } - - async saveToFile(logFile, logEntry) { - let task_id = this.agent.task.task_id; - console.log(task_id) - let logDir; - if (this.task_id === null) { - logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs`); - } else { - logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs/${task_id}`); - } - - await fs.mkdir(logDir, { recursive: true }); - - logFile = path.join(logDir, logFile); - await fs.appendFile(logFile, String(logEntry), 'utf-8'); - } - async promptConvo(messages) { - // console.log(`[${new Date().toISOString()}] promptConvo called with messages:`, messages); - this.most_recent_msg_time = Date.now(); let current_msg_time = this.most_recent_msg_time; @@ -371,15 +329,7 @@ export class Prompter { throw new Error('Generated response is not a string'); } console.log("Generated response:", generation); - const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); - let logEntry; - if (this.task_id === null) { - logEntry = `[${timestamp}] \nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\nResponse:\n${generation}\n\n`; - } else { - logEntry = `[${timestamp}] Task ID: ${task_id}\nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\nResponse:\n${generation}\n\n`; - } - const logFile = `conversation_${timestamp}.txt`; - await this.saveToFile(logFile, logEntry); + await this._saveLog(prompt, messages, generation, 'conversation'); } catch (error) { console.error('Error during message generation or file writing:', error); @@ -413,35 +363,19 @@ export class Prompter { let prompt = this.profile.coding; prompt = await this.replaceStrings(prompt, messages, this.coding_examples); - let logEntry; - const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); - if (this.task_id === null) { - logEntry = `[${timestamp}] \nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\n`; - } else { - logEntry = `[${timestamp}] Task ID: ${this.agent.task.task_id}\nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\n`; - } - - const logFile = `coding_${timestamp}.txt`; - await this.saveToFile(logFile, logEntry); let resp = await this.code_model.sendRequest(messages, prompt); this.awaiting_coding = false; + await this._saveLog(prompt, messages, resp, 'coding'); return resp; } async promptMemSaving(to_summarize) { await this.checkCooldown(); let prompt = this.profile.saving_memory; - let logEntry; - const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); - if (this.task_id === null) { - logEntry = `[${timestamp}] \nPrompt:\n${prompt}\n\nTo Summarize:\n${JSON.stringify(messages, null, 2)}\n\n`; - } else { - logEntry = `[${timestamp}] Task ID: ${this.agent.task.task_id}\nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(to_summarize, null, 2)}\n\n`; - } - const logFile = `memSaving_${timestamp}.txt`; - await this.saveToFile(logFile, logEntry); prompt = await this.replaceStrings(prompt, null, null, to_summarize); - return await this.chat_model.sendRequest([], prompt); + let resp = await this.chat_model.sendRequest([], prompt); + await this._saveLog(prompt, null, resp, 'memSaving'); + return resp; } async promptShouldRespondToBot(new_message) { @@ -455,6 +389,7 @@ export class Prompter { } async promptGoalSetting(messages, last_goals) { + // deprecated let system_message = this.profile.goal_setting; system_message = await this.replaceStrings(system_message, messages); @@ -479,4 +414,37 @@ export class Prompter { goal.quantity = parseInt(goal.quantity); return goal; } + + async _saveLog(prompt, messages, generation, tag) { + if (!settings.log_all_prompts) + return; + const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); + let logEntry; + let task_id = this.agent.task.task_id; + if (task_id == null) { + logEntry = `[${timestamp}] \nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\nResponse:\n${generation}\n\n`; + } else { + logEntry = `[${timestamp}] Task ID: ${task_id}\nPrompt:\n${prompt}\n\nConversation:\n${JSON.stringify(messages, null, 2)}\n\nResponse:\n${generation}\n\n`; + } + const logFile = `${tag}_${timestamp}.txt`; + await this._saveToFile(logFile, logEntry); + } + + async _saveToFile(logFile, logEntry) { + let task_id = this.agent.task.task_id; + console.log(task_id) + let logDir; + if (task_id == null) { + logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs`); + } else { + logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs/${task_id}`); + } + + await fs.mkdir(logDir, { recursive: true }); + + logFile = path.join(logDir, logFile); + await fs.appendFile(logFile, String(logEntry), 'utf-8'); + } + + } From e96131b8c5d89b5a973125c768561cfe5bdeb081 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 12 Mar 2025 14:18:53 -0500 Subject: [PATCH 04/15] added python requirements --- requirements.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7706406 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +boto3==1.37.11 +botocore==1.37.11 +javascript==1!1.2.2 +numpy==1.22.2 +opencv_python==4.10.0.84 +tqdm==4.62.3 From 7225699bf17f2893338d750661841ee95560c0c3 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 12 Mar 2025 14:19:59 -0500 Subject: [PATCH 05/15] move task json out of root --- example_tasks.json => tasks/example_tasks.json | 0 .../multiagent_crafting_tasks.json | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename example_tasks.json => tasks/example_tasks.json (100%) rename multiagent_crafting_tasks.json => tasks/multiagent_crafting_tasks.json (100%) diff --git a/example_tasks.json b/tasks/example_tasks.json similarity index 100% rename from example_tasks.json rename to tasks/example_tasks.json diff --git a/multiagent_crafting_tasks.json b/tasks/multiagent_crafting_tasks.json similarity index 100% rename from multiagent_crafting_tasks.json rename to tasks/multiagent_crafting_tasks.json From 753b8aa32b8ed369e2c04f07e3aa90bc5fab094c Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 12 Mar 2025 15:00:51 -0500 Subject: [PATCH 06/15] fix andy path --- settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.js b/settings.js index 5c16d27..e57ff23 100644 --- a/settings.js +++ b/settings.js @@ -13,7 +13,7 @@ export default // the base profile is shared by all bots for default prompts/examples/modes "base_profile": "./profiles/defaults/survival.json", // also see creative.json, god_mode.json "profiles": ((process.env.PROFILES) && JSON.parse(process.env.PROFILES)) || [ - "./profiles/andy.json", + "./andy.json", // "./profiles/gpt.json", // "./profiles/claude.json", // "./profiles/gemini.json", From 2597d32488317b7c79b4a2e7e971b7842f28be62 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 15 Mar 2025 14:16:03 -0500 Subject: [PATCH 07/15] move multi agent crafting tasks back --- ...ltiagent_crafting_tasks.json => multiagent_crafting_tasks.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tasks/multiagent_crafting_tasks.json => multiagent_crafting_tasks.json (100%) diff --git a/tasks/multiagent_crafting_tasks.json b/multiagent_crafting_tasks.json similarity index 100% rename from tasks/multiagent_crafting_tasks.json rename to multiagent_crafting_tasks.json From 57be4ec42ebda34717c539a976c6a0fb3206411d Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 19 Mar 2025 13:31:18 -0500 Subject: [PATCH 08/15] remove log --- src/models/prompter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/models/prompter.js b/src/models/prompter.js index 1d3b380..440160a 100644 --- a/src/models/prompter.js +++ b/src/models/prompter.js @@ -432,7 +432,6 @@ export class Prompter { async _saveToFile(logFile, logEntry) { let task_id = this.agent.task.task_id; - console.log(task_id) let logDir; if (task_id == null) { logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs`); From a6cb062862910d58c3fa04f7e3f57e1511f931d8 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 19 Mar 2025 13:53:50 -0500 Subject: [PATCH 09/15] add script to run all tasks in task file --- tasks/run_task_file.py | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tasks/run_task_file.py diff --git a/tasks/run_task_file.py b/tasks/run_task_file.py new file mode 100644 index 0000000..11fec7a --- /dev/null +++ b/tasks/run_task_file.py @@ -0,0 +1,58 @@ +# run all tasks in a given file + +import os +import json +import argparse +import subprocess +import time + +def run_task(task_path, task_id, profiles=None): + """Run a single task using main.js""" + # Convert task_path to absolute path if it's relative + if not os.path.isabs(task_path): + task_path = os.path.abspath(task_path) + + cmd = ["node", "main.js", "--task_path", task_path, "--task_id", task_id] + + # Add profiles if provided + if profiles: + cmd.extend(["--profiles", *profiles]) + + print(f"Running task: {task_id}") + + project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + # Execute the command from the project root directory + process = subprocess.run(cmd, check=True, cwd=project_root) + + return process.returncode == 0 + +def main(): + parser = argparse.ArgumentParser(description='Run all tasks in a JSON file sequentially') + parser.add_argument('--task_path', required=True, help='Path to the task file') + parser.add_argument('--profiles', nargs='+', help='List of agent profile paths') + parser.add_argument('--delay', type=int, default=2, help='Delay in seconds between tasks') + + args = parser.parse_args() + + # Load the task file + with open(args.task_path, 'r') as f: + tasks = json.load(f) + + print(f"Found {len(tasks)} tasks in {args.task_path}") + + # Run each task sequentially + successful_tasks = 0 + for task_id in tasks: + success = run_task(args.task_path, task_id, args.profiles) + if success: + successful_tasks += 1 + + # Wait between tasks + time.sleep(args.delay) + + print(f"Completed {successful_tasks}/{len(tasks)} tasks successfully") + +if __name__ == "__main__": + main() + From e0bbd661dd7bf100c5f01fb9d916020ecdd4fae2 Mon Sep 17 00:00:00 2001 From: Ayush Maniar Date: Thu, 20 Mar 2025 12:56:29 -0700 Subject: [PATCH 10/15] Fixed validator not getting executed after agent exiting the world due to smelting, by clearing inventories in the end --- src/agent/tasks.js | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/src/agent/tasks.js b/src/agent/tasks.js index 141d1a4..0e2f8bb 100644 --- a/src/agent/tasks.js +++ b/src/agent/tasks.js @@ -126,25 +126,16 @@ class CookingCraftingTaskValidator { this.data = data; this.agent = agent; } - validate(has_initiated) { - if (has_initiated) { - - const result = checkItemPresence(this.data, this.agent); - let score = 0; - if (result.success) { - score = 1; - } - return { - "valid": result.success, - "score": score, - }; - } - else { - return { - "valid": false, - "score": 0 - }; + validate() { + const result = checkItemPresence(this.data, this.agent); + let score = 0; + if (result.success) { + score = 1; } + return { + "valid": result.success, + "score": score, + }; } } @@ -202,7 +193,6 @@ export class Task { this.name = this.agent.name; this.available_agents = settings.profiles.map((p) => JSON.parse(readFileSync(p, 'utf8')).name); - this.agent_initialized = false; } getAgentGoal() { @@ -213,7 +203,7 @@ export class Task { let add_string = ''; if (this.task_type === 'cooking') { - add_string = '\nIn the end, all the food items should be given to one single player.'; + add_string = '\nIn the end, all the food items should be given to one single bot.'; } // If goal is a string, all agents share the same goal @@ -254,8 +244,12 @@ export class Task { isDone() { let res = null; if (this.validator) - res = this.validator.validate(this.agent_initialized); + res = this.validator.validate(); if (res && res.valid) { + // Find all the agents and clear their inventories + for (let agent of this.available_agents) { + this.agent.bot.chat(`/clear ${agent}`); + } return {"message": 'Task successful', "score": res.score}; } let other_names = this.available_agents.filter(n => n !== this.name); @@ -326,8 +320,6 @@ export class Task { await new Promise((resolve) => setTimeout(resolve, 500)); } - this.agent_initialized = true; - if (this.initiator) { await this.initiator.init(); } From cdeb50600f4d03c8afa0d5242fb53727c32c2de6 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Thu, 20 Mar 2025 15:24:06 -0500 Subject: [PATCH 11/15] add strict format to messages to help qwen and deepseek models --- src/models/vllm.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/models/vllm.js b/src/models/vllm.js index b9bc7d6..fdc14af 100644 --- a/src/models/vllm.js +++ b/src/models/vllm.js @@ -22,6 +22,8 @@ export class VLLM { async sendRequest(turns, systemMessage, stop_seq = '***') { let messages = [{ 'role': 'system', 'content': systemMessage }].concat(turns); + + messages = strictFormat(messages); const pack = { model: this.model_name || "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", @@ -51,4 +53,20 @@ export class VLLM { return res; } + async saveToFile(logFile, logEntry) { + let task_id = this.agent.task.task_id; + console.log(task_id) + let logDir; + if (this.task_id === null) { + logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs`); + } else { + logDir = path.join(__dirname, `../../bots/${this.agent.name}/logs/${task_id}`); + } + + await fs.mkdir(logDir, { recursive: true }); + + logFile = path.join(logDir, logFile); + await fs.appendFile(logFile, String(logEntry), 'utf-8'); + } + } \ No newline at end of file From 056e1bce53f468d2c51ed3d7782566247a07e278 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Thu, 20 Mar 2025 15:27:16 -0500 Subject: [PATCH 12/15] backwards compatibility for llama --- src/models/vllm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/vllm.js b/src/models/vllm.js index fdc14af..7070d15 100644 --- a/src/models/vllm.js +++ b/src/models/vllm.js @@ -23,7 +23,10 @@ export class VLLM { async sendRequest(turns, systemMessage, stop_seq = '***') { let messages = [{ 'role': 'system', 'content': systemMessage }].concat(turns); - messages = strictFormat(messages); + if (this.model_name.includes("deepseek") || this.model_name.inclues("qwen")) { + messages = strictFormat(messages); + } + const pack = { model: this.model_name || "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", From e3d61ceead03acb14e422923171017bbc8ad2573 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Thu, 20 Mar 2025 15:36:45 -0500 Subject: [PATCH 13/15] changing task path --- evaluation_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluation_script.py b/evaluation_script.py index 076b3da..3df9077 100644 --- a/evaluation_script.py +++ b/evaluation_script.py @@ -399,7 +399,7 @@ def make_ops(agent_names, session_name): """Make the agents operators in the Minecraft world.""" print('Making agents operators...') - cmd = f"node main.js --task_path example_tasks.json --task_id debug_{len(agent_names)}_agent_timeout" + cmd = f"node main.js --task_path tasks/example_tasks.json --task_id debug_{len(agent_names)}_agent_timeout" subprocess.run(["tmux", "send-keys", "-t", session_name, cmd, "C-m"]) From 6526985b90863d61c2f7e244b546c11ed5cb3001 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Thu, 20 Mar 2025 15:45:20 -0500 Subject: [PATCH 14/15] added back missing import to vllm js --- src/models/vllm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/vllm.js b/src/models/vllm.js index 7070d15..a9a5bb1 100644 --- a/src/models/vllm.js +++ b/src/models/vllm.js @@ -3,6 +3,7 @@ import OpenAIApi from 'openai'; import { getKey, hasKey } from '../utils/keys.js'; +import { strictFormat } from '../utils/text.js'; export class VLLM { constructor(model_name, url) { From fa03061621860863849755a5b1da0cd1b011dd17 Mon Sep 17 00:00:00 2001 From: Ayush Maniar Date: Thu, 20 Mar 2025 16:34:23 -0700 Subject: [PATCH 15/15] Remove door and improve multi-agent collaboration for 3+ tasks --- src/agent/task_types/cooking_tasks.js | 9 +++++---- src/agent/tasks.js | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/agent/task_types/cooking_tasks.js b/src/agent/task_types/cooking_tasks.js index d4c7804..dcb98b4 100644 --- a/src/agent/task_types/cooking_tasks.js +++ b/src/agent/task_types/cooking_tasks.js @@ -256,10 +256,11 @@ export class CookingTaskInitiator { // Entrance features const doorZ = startZ + Math.floor(width / 2); await bot.chat(`/setblock ${startX + depth - 1} ${startY} ${doorZ} stone_brick_stairs[facing=west]`); - await bot.chat(`/setblock ${startX + depth - 1} ${startY} ${doorZ - 1} stone_bricks`); - await bot.chat(`/setblock ${startX + depth - 1} ${startY} ${doorZ + 1} stone_bricks`); - await bot.chat(`/setblock ${startX + depth} ${startY} ${doorZ} oak_door[half=lower,hinge=left,facing=west,powered=false]`); - await bot.chat(`/setblock ${startX + depth} ${startY + 1} ${doorZ} oak_door[half=upper,hinge=left,facing=west,powered=false]`); + await bot.chat(`/setblock ${startX + depth} ${startY} ${doorZ} air`); + // await bot.chat(`/setblock ${startX + depth - 1} ${startY} ${doorZ - 1} stone_bricks`); + // await bot.chat(`/setblock ${startX + depth - 1} ${startY} ${doorZ + 1} stone_bricks`); + // await bot.chat(`/setblock ${startX + depth} ${startY} ${doorZ} oak_door[half=lower,hinge=left,facing=west,powered=false]`); + // await bot.chat(`/setblock ${startX + depth} ${startY + 1} ${doorZ} oak_door[half=upper,hinge=left,facing=west,powered=false]`); // Roof construction for (let i = 0; i < 3; i++) { diff --git a/src/agent/tasks.js b/src/agent/tasks.js index 0e2f8bb..fc29763 100644 --- a/src/agent/tasks.js +++ b/src/agent/tasks.js @@ -348,9 +348,9 @@ export class Task { await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`); } - const agentGoal = this.getAgentGoal(); - console.log(`Agent goal for agent Id ${this.agent.count_id}: ${agentGoal}`); + let agentGoal = this.getAgentGoal(); if (agentGoal) { + agentGoal += "You have to collaborate with other agents/bots, namely " + this.available_agents.filter(n => n !== this.name).join(', ') + " to complete the task as soon as possible by dividing the work among yourselves."; console.log(`Setting goal for agent ${this.agent.count_id}: ${agentGoal}`); await executeCommand(this.agent, `!goal("${agentGoal}")`); }