Remove the fixed round limit from AI development tasks
This commit is contained in:
1 parent
36ee771ef0
commit
66d339fbed
5 files changed
+34
-13
No files matched your search
@@ -159,11 +159,6 @@ public class AgentWorker {
|
||||
tasks.finish(id, lease, "PAUSED", "用户暂停,预算继续保留", false);
|
||||
return;
|
||||
}
|
||||
if (((Number) task.get("step_count")).intValue()
|
||||
>= ((Number) task.get("max_steps")).intValue()) {
|
||||
tasks.finish(id, lease, "PAUSED", "达到步骤上限,请核对当前项目进度", false);
|
||||
return;
|
||||
}
|
||||
if (tasks.remaining(reservation).compareTo(bound) < 0) {
|
||||
tasks.finish(id, lease, "PAUSED", "剩余预算不足以覆盖一次最坏情况下的调用,请取消后调整预算重新发起", false);
|
||||
return;
|
||||
|
||||
@@ -429,10 +429,7 @@ public class TaskService {
|
||||
if (action.equals("cancel") && (stopping || status.equals("CANCELLED"))) return find(id, user);
|
||||
if (stopping) throw new ApiError.Failure(409, "任务正在停止");
|
||||
if (action.equals("resume") && status.equals("PAUSED")) {
|
||||
db.update(
|
||||
"UPDATE ai_tasks SET status='QUEUED',error='',requested_action='',max_steps=CASE WHEN"
|
||||
+ " max_steps<=step_count THEN step_count+30 ELSE max_steps END WHERE id=?",
|
||||
id);
|
||||
db.update("UPDATE ai_tasks SET status='QUEUED',error='',requested_action='' WHERE id=?", id);
|
||||
event(id, "QUEUED", "用户继续任务");
|
||||
} else if (action.equals("pause") && (status.equals("QUEUED") || status.equals("RUNNING"))) {
|
||||
if (status.equals("QUEUED")) db.update("UPDATE ai_tasks SET status='PAUSED' WHERE id=?", id);
|
||||
|
||||
Reference in new issue
Block a user