feat: integrate reviewed batches and preserve task continuation

This commit is contained in:
Agent Workbench Dev
2026-10-29 19:33:24 +08:00
parent 5d03af968c
commit 719174e2b1
43 changed files with 799 additions and 60 deletions
+3 -1
View File
@@ -103,7 +103,9 @@ export class Runtime {
continueReviewed(id) {
const session = this.store.session(id), run = this.store.core.run.get(session.runId), task = this.store.core.task.get(session.taskId);
if (this.isActive(id) || this.checks?.projectActive(session.projectId)) throw Object.assign(new Error('请等待正在执行的任务或检查结束。'), { status: 409 });
if (!task || run?.taskId !== task.id || run?.status !== 'needs_review' || session.changes.some(change => ['pending', 'conflict'].includes(change.status))
const stoppedForReview = run?.status === 'needs_review' || run?.status === 'paused' && run.stopReason === 'step_limit';
if (!task || run?.taskId !== task.id || !stoppedForReview || session.changes.some(change => ['pending', 'conflict'].includes(change.status))
|| [...this.store.core.tool.values()].some(tool => tool.taskId === task.id && tool.requiresVerification)
|| !session.changes.some(change => change.status === 'applied' && (!change.taskId || change.taskId === task.id))) throw Object.assign(new Error('当前没有已审查并应用、需要继续交付的任务改动。'), { status: 409 });
const content = '本任务的改动已经审查并应用。请继续原始目标,识别并实际执行工程检查,依据失败日志修复,完成审查和交付说明。';
return this.start(id, content, true, { instructionSource: 'review-action' });