fix: harden production chat runtime
This commit is contained in:
@@ -188,6 +188,12 @@ test("POST /api/v1/projects/[projectId]/dispatch-plans/[planId]/confirm confirms
|
||||
plan: { planId: string; status: string; confirmedTargetProjectIds: string[] };
|
||||
executions: Array<{ planId: string; targetProjectId: string; status: string }>;
|
||||
notice: { kind: string; body: string } | null;
|
||||
collaborationGate: {
|
||||
isGroup: boolean;
|
||||
collaborationMode: string;
|
||||
requiresMasterAgentApproval: boolean;
|
||||
approvalState: string;
|
||||
};
|
||||
};
|
||||
assert.equal(payload.ok, true);
|
||||
assert.equal(payload.plan.planId, dispatchPlan.planId);
|
||||
@@ -200,6 +206,10 @@ test("POST /api/v1/projects/[projectId]/dispatch-plans/[planId]/confirm confirms
|
||||
assert.ok(payload.notice, "expected a confirmation notice in the response");
|
||||
assert.equal(payload.notice?.kind, "system_notice");
|
||||
assert.equal(payload.notice?.body, "已确认下发到 1 个线程:《北区试产线回归》。");
|
||||
assert.equal(payload.collaborationGate.isGroup, true);
|
||||
assert.equal(payload.collaborationGate.collaborationMode, "development");
|
||||
assert.equal(payload.collaborationGate.requiresMasterAgentApproval, false);
|
||||
assert.equal(payload.collaborationGate.approvalState, "not_required");
|
||||
|
||||
const nextState = await readState();
|
||||
const notice = nextState.projects
|
||||
@@ -279,12 +289,22 @@ test("rejecting a dispatch plan marks approval_required groups as rejected and w
|
||||
ok: boolean;
|
||||
plan: { planId: string; status: string };
|
||||
notice: { kind: string; body: string };
|
||||
collaborationGate: {
|
||||
isGroup: boolean;
|
||||
collaborationMode: string;
|
||||
requiresMasterAgentApproval: boolean;
|
||||
approvalState: string;
|
||||
};
|
||||
};
|
||||
assert.equal(payload.ok, true);
|
||||
assert.equal(payload.plan.planId, dispatchPlan.planId);
|
||||
assert.equal(payload.plan.status, "rejected");
|
||||
assert.equal(payload.notice.kind, "system_notice");
|
||||
assert.equal(payload.notice.body, "已拒绝主 Agent 推荐,本次不会下发到任何线程。");
|
||||
assert.equal(payload.collaborationGate.isGroup, true);
|
||||
assert.equal(payload.collaborationGate.collaborationMode, "approval_required");
|
||||
assert.equal(payload.collaborationGate.requiresMasterAgentApproval, true);
|
||||
assert.equal(payload.collaborationGate.approvalState, "rejected");
|
||||
|
||||
const nextState = await readState();
|
||||
const nextGroupProject = nextState.projects.find((project) => project.id === groupProject.id);
|
||||
|
||||
Reference in New Issue
Block a user