diff --git a/example_tasks.json b/example_tasks.json index f828d9a..9d1796b 100644 --- a/example_tasks.json +++ b/example_tasks.json @@ -72,5 +72,24 @@ "number_of_target": 1, "type": "techtree", "timeout": 300 + }, + "multiagent_smelt_ingot": { + "conversation": "Let's collaborate to smelt ingots", + "goal": "Smelt 1 iron ingot and 1 copper ingot, use star emojis in every response", + "agent_count": 2, + "initial_inventory": { + "0": { + "furnace": 1, + "coal": 2 + }, + "1": { + "raw_iron": 1, + "raw_copper": 1 + } + }, + "target": "copper_ingot", + "number_of_target": 1, + "type": "techtree", + "timeout": 300 } } \ No newline at end of file diff --git a/src/agent/self_prompter.js b/src/agent/self_prompter.js index aae8371..3251f0e 100644 --- a/src/agent/self_prompter.js +++ b/src/agent/self_prompter.js @@ -127,11 +127,13 @@ export class SelfPrompter { async pause() { this.interrupt = true; + await this.agent.actions.stop(); + this.stopLoop(); this.state = PAUSED; } shouldInterrupt(is_self_prompt) { // to be called from handleMessage - return is_self_prompt && this.state === ACTIVE && this.interrupt; + return is_self_prompt && (this.state === ACTIVE || this.state === PAUSED) && this.interrupt; } handleUserPromptedCmd(is_self_prompt, is_action) {