fix: preserve task intent across diagnostics and review continuation
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { taskContract } from './task-control.mjs';
|
||||
|
||||
export const EXECUTION_SCHEMA = 1;
|
||||
export const ACTIVE_STATES = new Set(['running', 'awaiting_approval', 'stopping']);
|
||||
@@ -49,13 +50,16 @@ export const accountedTokens = usage => (usage?.totalTokens ?? 0) + (usage?.esti
|
||||
|
||||
export function createTask(session, goal, config, previousTaskId = null) {
|
||||
const at = timestamp();
|
||||
return {
|
||||
const task = {
|
||||
schemaVersion: EXECUTION_SCHEMA, id: randomUUID(), sessionId: session.id, projectId: session.projectId,
|
||||
goal: String(goal), instructions: [], constraints: [], acceptance: [], status: 'idle',
|
||||
previousTaskId, createdAt: at, updatedAt: at, activeRunId: null,
|
||||
usage: emptyUsage(), budget: { maxTokens: executionBudget(config).maxTaskTokens },
|
||||
verification: { status: 'not_configured', checkJobId: null }, origin: 'workbench',
|
||||
};
|
||||
task.contract = taskContract(task);
|
||||
if (task.contract.checks === 'skip') task.constraints.push('用户明确要求无需测试;不得自动扩大为工程测试任务。');
|
||||
return task;
|
||||
}
|
||||
|
||||
export function createRun(session, task, config, resumeOf = null) {
|
||||
|
||||
Reference in New Issue
Block a user