Skip to content

Commit c1c1984

Browse files
committed
✨ Random ass fix
1 parent 2dc10dc commit c1c1984

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

next/src/services/agent/autonomous-agent.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,17 @@ class AutonomousAgent {
141141

142142
async chat(message: string) {
143143
if (this.model.getLifecycle() == "running") this.pauseAgent();
144+
let paused = false;
145+
if (this.model.getLifecycle() == "stopped") {
146+
paused = true;
147+
this.model.setLifecycle("pausing");
148+
}
144149
const chatWork = new ChatWork(this, message);
145150
await this.runWork(chatWork);
146151
await chatWork.conclude();
152+
if (paused) {
153+
this.model.setLifecycle("stopped");
154+
}
147155
}
148156

149157
async createTaskMessages(tasks: string[]) {

0 commit comments

Comments
 (0)