feat: harden ai onboarding and approval chat flows

This commit is contained in:
kris
2026-03-31 04:18:57 +08:00
parent 4336dc22a7
commit 0cb2171dd3
16 changed files with 551 additions and 27 deletions

View File

@@ -270,6 +270,14 @@ test("POST /api/v1/projects/[projectId]/messages marks approval_required groups
const persistedGroup = nextState.projects.find((project) => project.id === groupProject.id);
assert.ok(persistedGroup, "expected group project to persist");
assert.equal(persistedGroup?.approvalState, "pending_user");
const pendingNotice = persistedGroup?.messages.find(
(message) =>
message.sender === "master" &&
message.kind === "system_notice" &&
message.body.includes("等待你确认"),
);
assert.ok(pendingNotice, "expected an approval notice to be persisted in the group ledger");
assert.match(pendingNotice?.body ?? "", /等待你确认|待审批|待确认/);
});
test("POST /api/v1/projects/[projectId]/messages keeps message success when group dispatch recommendation fails", async () => {