refactor: slim thread execution prompts

This commit is contained in:
kris
2026-04-04 03:43:21 +08:00
parent 829005ba66
commit 2f741c327f
4 changed files with 27 additions and 20 deletions

View File

@@ -175,6 +175,12 @@ async function createConfirmedDispatchExecution() {
task.requestMessageId === messagePayload.dispatchPlan?.planId,
);
assert.ok(executionTask, "expected a queued dispatch execution master-agent task");
assert.ok(executionTask?.executionPrompt?.includes("请主 Agent 推荐要先同步的线程"));
assert.ok(executionTask?.executionPrompt?.includes(executionTask?.targetThreadDisplayName ?? ""));
assert.ok(!executionTask?.executionPrompt?.includes("groupProjectId:"), "dispatch prompt should not include group project id labels");
assert.ok(!executionTask?.executionPrompt?.includes("threadProjectId:"), "dispatch prompt should not include thread project id labels");
assert.ok(!executionTask?.executionPrompt?.includes("threadId:"), "dispatch prompt should not include raw thread id labels");
assert.ok(!executionTask?.executionPrompt?.includes("folderName:"), "dispatch prompt should not include folder labels");
return { groupProject, execution, executionTask };
}

View File

@@ -103,6 +103,11 @@ test("POST /api/v1/projects/[projectId]/messages enqueues a conversation task fo
assert.ok(task, "expected a queued conversation_reply task for the single-thread project");
assert.equal(task?.targetProjectId, singleProject.id);
assert.equal(task?.targetThreadId, singleProject.threadMeta.threadId);
assert.ok(task?.executionPrompt?.includes("请同步一下当前阻塞情况"));
assert.ok(task?.executionPrompt?.includes(singleProject.threadMeta.threadDisplayName));
assert.ok(!task?.executionPrompt?.includes("threadProjectId:"), "thread prompt should not include project id labels");
assert.ok(!task?.executionPrompt?.includes("folderName:"), "thread prompt should not include folder labels");
assert.ok(!task?.executionPrompt?.includes("deviceIds:"), "thread prompt should not include device id labels");
});
test("POST /api/v1/master-agent/tasks/[taskId]/complete writes the raw thread reply back to the single-thread project", async () => {