mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
..and lil coder unstuck bug
This commit is contained in:
parent
547d18f3df
commit
eb2dd28083
1 changed files with 2 additions and 2 deletions
|
@ -91,6 +91,8 @@ export class Coder {
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateCodeLoop(agent_history) {
|
async generateCodeLoop(agent_history) {
|
||||||
|
this.agent.bot.modes.pause('unstuck');
|
||||||
|
|
||||||
let messages = agent_history.getHistory();
|
let messages = agent_history.getHistory();
|
||||||
messages.push({role: 'system', content: 'Code generation started. Write code in codeblock in your response:'});
|
messages.push({role: 'system', content: 'Code generation started. Write code in codeblock in your response:'});
|
||||||
|
|
||||||
|
@ -102,7 +104,6 @@ export class Coder {
|
||||||
if (this.agent.bot.interrupt_code)
|
if (this.agent.bot.interrupt_code)
|
||||||
return interrupt_return;
|
return interrupt_return;
|
||||||
console.log(messages)
|
console.log(messages)
|
||||||
this.agent.bot.modes.pause('unstuck');
|
|
||||||
let res = await this.agent.prompter.promptCoding(JSON.parse(JSON.stringify(messages)));
|
let res = await this.agent.prompter.promptCoding(JSON.parse(JSON.stringify(messages)));
|
||||||
if (this.agent.bot.interrupt_code)
|
if (this.agent.bot.interrupt_code)
|
||||||
return interrupt_return;
|
return interrupt_return;
|
||||||
|
@ -137,7 +138,6 @@ export class Coder {
|
||||||
code_return = await this.execute(async ()=>{
|
code_return = await this.execute(async ()=>{
|
||||||
return await execution_file.main(this.agent.bot);
|
return await execution_file.main(this.agent.bot);
|
||||||
}, settings.code_timeout_mins);
|
}, settings.code_timeout_mins);
|
||||||
this.agent.bot.modes.unpause('unstuck');
|
|
||||||
if (code_return.interrupted && !code_return.timedout)
|
if (code_return.interrupted && !code_return.timedout)
|
||||||
return {success: false, message: null, interrupted: true, timedout: false};
|
return {success: false, message: null, interrupted: true, timedout: false};
|
||||||
console.log("Code generation result:", code_return.success, code_return.message);
|
console.log("Code generation result:", code_return.success, code_return.message);
|
||||||
|
|
Loading…
Add table
Reference in a new issue