fixed shouldInterrupt, added test task

This commit is contained in:
MaxRobinsonTheGreat 2025-02-20 18:17:06 -06:00
parent b23f4776b1
commit 31bce024a2
2 changed files with 22 additions and 1 deletions

View file

@ -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
}
}

View file

@ -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) {