fix: 执行器只试一次,失败直接needs_llm升级
- 去掉重试逻辑:每10分钟试1次,失败→立刻needs_llm - 无fix_action也走needs_llm(不搁置) - 执行器deliver=origin,needs_llm输出会到达Dad - 知微启动时/被叫时检查needs_llm→直接处理
This commit is contained in:
@@ -60,19 +60,16 @@ def main():
|
|||||||
todo_id = row["id"]
|
todo_id = row["id"]
|
||||||
title = row["title"]
|
title = row["title"]
|
||||||
fix_action = row["fix_action"]
|
fix_action = row["fix_action"]
|
||||||
retry_count = row["retry_count"]
|
|
||||||
max_retries = row["max_retries"]
|
|
||||||
|
|
||||||
if not fix_action:
|
if not fix_action:
|
||||||
# 没有fix_action就不应该创建这个TODO,跳过
|
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"UPDATE todos SET status='completed', note='无修复命令,跳过', "
|
"UPDATE todos SET status='needs_llm', note='无fix_action需人工分析', "
|
||||||
"updated_at=CURRENT_TIMESTAMP WHERE id=?", (todo_id,))
|
"updated_at=CURRENT_TIMESTAMP WHERE id=?", (todo_id,))
|
||||||
results.append(("⏭️", f"{title}: 无修复命令"))
|
results.append(("🔶", f"{title}: 需知微分析(无修复方案)"))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# 执行
|
# 执行(只试一次,失败立即升级)
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"UPDATE todos SET status='in_progress', updated_at=CURRENT_TIMESTAMP WHERE id=?",
|
"UPDATE todos SET status='in_progress', updated_at=CURRENT_TIMESTAMP WHERE id=?",
|
||||||
(todo_id,))
|
(todo_id,))
|
||||||
@@ -86,20 +83,11 @@ def main():
|
|||||||
(f"已修复: {output[:200]}", todo_id))
|
(f"已修复: {output[:200]}", todo_id))
|
||||||
results.append(("✅", f"{title}: 已修复"))
|
results.append(("✅", f"{title}: 已修复"))
|
||||||
else:
|
else:
|
||||||
retry_count += 1
|
conn.execute(
|
||||||
if retry_count >= max_retries:
|
"UPDATE todos SET status='needs_llm', note=?, "
|
||||||
# 重试用完,超出能力范围→标记需LLM处理
|
"updated_at=CURRENT_TIMESTAMP WHERE id=?",
|
||||||
conn.execute(
|
(f"执行失败: {output[:200]}", todo_id))
|
||||||
"UPDATE todos SET status='needs_llm', retry_count=?, "
|
results.append(("🔶", f"{title}: 需知微介入({output[:60]})"))
|
||||||
"note=?, updated_at=CURRENT_TIMESTAMP WHERE id=?",
|
|
||||||
(retry_count, f"尝试{retry_count}次仍失败: {output[:150]}", todo_id))
|
|
||||||
results.append(("🔶", f"{title}: 需知微介入(重试{retry_count}次失败)"))
|
|
||||||
else:
|
|
||||||
conn.execute(
|
|
||||||
"UPDATE todos SET status='pending', retry_count=?, "
|
|
||||||
"note=?, updated_at=CURRENT_TIMESTAMP WHERE id=?",
|
|
||||||
(retry_count, f"第{retry_count}次失败: {output[:100]}", todo_id))
|
|
||||||
results.append(("🔄", f"{title}: 重试{retry_count}/{max_retries}"))
|
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user