fix(runtime): apply open policy when continuing legacy tasks
This commit is contained in:
@@ -509,6 +509,9 @@ export class Store extends EventEmitter {
|
||||
task.workspaceIdentity ??= structuredClone(workspaceIdentity);
|
||||
if (JSON.stringify(task.workspaceIdentity) !== JSON.stringify(workspaceIdentity)) throw Object.assign(new Error('任务的工作区身份已变化,不能将原任务移动到另一个工作区。'), { status: 409 });
|
||||
const run = createRun(session, task, config, resume || continuing ? previousRunId : null);
|
||||
// A new open Run adopts the user's current policy even when it continues
|
||||
// an exhausted legacy Task. Historical Run budgets and usage stay intact.
|
||||
if (unrestricted(config)) task.budget.maxTokens = 0;
|
||||
run.purpose = purpose;
|
||||
if (purpose === 'diagnostic') {
|
||||
run.question = String(content); run.taskStatusBefore = task.status;
|
||||
|
||||
Reference in New Issue
Block a user