feat: surface auto project sync guidance in master chat
This commit is contained in:
@@ -6233,6 +6233,17 @@ export async function completeMasterAgentTask(payload: {
|
||||
body: buildProjectUnderstandingUpdateDigest(targetProject.name, understanding),
|
||||
kind: "system_notice",
|
||||
});
|
||||
if (
|
||||
understanding.recommendedNextStep?.trim() &&
|
||||
previousUnderstanding?.recommendedNextStep !== understanding.recommendedNextStep
|
||||
) {
|
||||
pushProjectLedgerMessage(state, "master-agent", {
|
||||
sender: "master",
|
||||
senderLabel: "主 Agent",
|
||||
body: buildProjectUnderstandingNextStepNotice(targetProject.name, understanding),
|
||||
kind: "system_notice",
|
||||
});
|
||||
}
|
||||
publishBossEvent("project.messages.updated", { projectId: "master-agent" });
|
||||
publishBossEvent("conversation.updated", { projectId: "master-agent" });
|
||||
}
|
||||
@@ -7396,6 +7407,12 @@ function buildProjectUnderstandingUpdateDigest(projectName: string, snapshot: Pr
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
function buildProjectUnderstandingNextStepNotice(projectName: string, snapshot: ProjectUnderstandingSnapshot) {
|
||||
return [`建议下一步推进:${projectName}`, snapshot.recommendedNextStep?.trim() || ""]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
function shouldQueueProjectUnderstandingSync(project: Project, observedActivityAt: string, state: BossState) {
|
||||
if (!isDispatchableThreadProject(project)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user