(params: {
partialService: ReturnType<typeof createTaskServiceHarness>["partialService"];
parentId: string;
messageId: string;
toolCallId: string;
title: string;
n?: number;
variants?: string[];
timestamp: number;
prompt?: string;
additionalParts?: MuxMessage["parts"];
})
| 11558 | } |
| 11559 | |
| 11560 | async function writePendingBestOfParentPartial(params: { |
| 11561 | partialService: ReturnType<typeof createTaskServiceHarness>["partialService"]; |
| 11562 | parentId: string; |
| 11563 | messageId: string; |
| 11564 | toolCallId: string; |
| 11565 | title: string; |
| 11566 | n?: number; |
| 11567 | variants?: string[]; |
| 11568 | timestamp: number; |
| 11569 | prompt?: string; |
| 11570 | additionalParts?: MuxMessage["parts"]; |
| 11571 | }): Promise<void> { |
| 11572 | const parentPartial = createMuxMessage( |
| 11573 | params.messageId, |
| 11574 | "assistant", |
| 11575 | "Waiting on best-of subagents…", |
| 11576 | { timestamp: params.timestamp }, |
| 11577 | [ |
| 11578 | { |
| 11579 | type: "dynamic-tool", |
| 11580 | toolCallId: params.toolCallId, |
| 11581 | toolName: "task", |
| 11582 | input: { |
| 11583 | subagent_type: "explore", |
| 11584 | prompt: params.prompt ?? "compare options", |
| 11585 | title: params.title, |
| 11586 | ...(params.n != null ? { n: params.n } : {}), |
| 11587 | ...(params.variants ? { variants: params.variants } : {}), |
| 11588 | }, |
| 11589 | state: "input-available", |
| 11590 | }, |
| 11591 | ...(params.additionalParts ?? []), |
| 11592 | ] |
| 11593 | ); |
| 11594 | expect((await params.partialService.writePartial(params.parentId, parentPartial)).success).toBe( |
| 11595 | true |
| 11596 | ); |
| 11597 | } |
| 11598 | |
| 11599 | function getTaskToolPart( |
| 11600 | message: MuxMessage | null |
no test coverage detected