feat: add omx orchestration backend selection
This commit is contained in:
@@ -151,9 +151,18 @@ async function createDispatchPlanForTest() {
|
||||
);
|
||||
assert.equal(response.status, 200);
|
||||
const payload = (await response.json()) as {
|
||||
dispatchPlan: { planId: string; targets: Array<{ projectId: string }> } | null;
|
||||
dispatchPlan:
|
||||
| {
|
||||
planId: string;
|
||||
targets: Array<{ projectId: string }>;
|
||||
orchestrationBackendId?: string;
|
||||
orchestrationBackendLabel?: string;
|
||||
}
|
||||
| null;
|
||||
};
|
||||
assert.ok(payload.dispatchPlan, "expected seeded dispatch plan");
|
||||
assert.equal(payload.dispatchPlan?.orchestrationBackendId, "boss-native-orchestrator");
|
||||
assert.equal(payload.dispatchPlan?.orchestrationBackendLabel, "Boss Native Orchestrator");
|
||||
return { groupProject, dispatchPlan: payload.dispatchPlan };
|
||||
}
|
||||
|
||||
@@ -195,8 +204,20 @@ test("POST /api/v1/projects/[projectId]/dispatch-plans/[planId]/confirm confirms
|
||||
|
||||
const payload = (await response.json()) as {
|
||||
ok: boolean;
|
||||
plan: { planId: string; status: string; confirmedTargetProjectIds: string[] };
|
||||
executions: Array<{ planId: string; targetProjectId: string; status: string }>;
|
||||
plan: {
|
||||
planId: string;
|
||||
status: string;
|
||||
confirmedTargetProjectIds: string[];
|
||||
orchestrationBackendId?: string;
|
||||
orchestrationBackendLabel?: string;
|
||||
};
|
||||
executions: Array<{
|
||||
planId: string;
|
||||
targetProjectId: string;
|
||||
status: string;
|
||||
orchestrationBackendId?: string;
|
||||
orchestrationBackendLabel?: string;
|
||||
}>;
|
||||
notice: { kind: string; body: string } | null;
|
||||
collaborationGate: {
|
||||
isGroup: boolean;
|
||||
@@ -231,6 +252,23 @@ test("POST /api/v1/projects/[projectId]/dispatch-plans/[planId]/confirm confirms
|
||||
message.body.includes("已确认下发到 1 个线程"),
|
||||
);
|
||||
assert.ok(notice, "expected a master-agent notice in the group chat after confirmation");
|
||||
const confirmedPlan = nextState.dispatchPlans.find((plan) => plan.planId === dispatchPlan.planId);
|
||||
assert.ok(confirmedPlan, "expected confirmed dispatch plan in state");
|
||||
assert.equal(confirmedPlan?.orchestrationBackendId, "boss-native-orchestrator");
|
||||
assert.equal(confirmedPlan?.orchestrationBackendLabel, "Boss Native Orchestrator");
|
||||
const createdExecution = nextState.dispatchExecutions.find((item) => item.planId === dispatchPlan.planId);
|
||||
assert.ok(createdExecution, "expected dispatch execution in state");
|
||||
assert.equal(createdExecution?.orchestrationBackendId, "boss-native-orchestrator");
|
||||
assert.equal(createdExecution?.orchestrationBackendLabel, "Boss Native Orchestrator");
|
||||
const executionTask = nextState.masterAgentTasks.find(
|
||||
(task) =>
|
||||
task.taskType === "dispatch_execution" &&
|
||||
task.projectId === groupProject.id &&
|
||||
task.targetProjectId === approvedTargetProjectId,
|
||||
);
|
||||
assert.ok(executionTask, "expected queued dispatch execution task");
|
||||
assert.equal(executionTask?.orchestrationBackendId, "boss-native-orchestrator");
|
||||
assert.equal(executionTask?.orchestrationBackendLabel, "Boss Native Orchestrator");
|
||||
});
|
||||
|
||||
test("confirming a dispatch plan marks approval_required groups as approved", async () => {
|
||||
|
||||
Reference in New Issue
Block a user