






















@@ -2613,55 +2613,44 @@ describe("matrix live qa scenarios", () => {
2613261326142614const scenario = requireMatrixQaScenario("matrix-room-quiet-streaming-preview");
261526152616-await expect(
2617-runMatrixQaScenario(scenario, {
2618-baseUrl: "http://127.0.0.1:28008/",
2619-canary: undefined,
2620-driverAccessToken: "driver-token",
2621-driverUserId: "@driver:matrix-qa.test",
2622-observedEvents: [],
2623-observerAccessToken: "observer-token",
2624-observerUserId: "@observer:matrix-qa.test",
2625-roomId: "!main:matrix-qa.test",
2626-restartGateway: undefined,
2627-syncState: {},
2628-sutAccessToken: "sut-token",
2629-sutUserId: "@sut:matrix-qa.test",
2630-timeoutMs: 8_000,
2631-topology: {
2632-defaultRoomId: "!main:matrix-qa.test",
2633-defaultRoomKey: "main",
2634-rooms: [],
2635-},
2636-}),
2637-).resolves.toMatchObject({
2638-artifacts: {
2639-driverEventId: "$quiet-stream-trigger",
2640-previewEventId: "$quiet-preview",
2641-reply: {
2642-eventId: "$quiet-final",
2643-},
2616+const result = await runMatrixQaScenario(scenario, {
2617+baseUrl: "http://127.0.0.1:28008/",
2618+canary: undefined,
2619+driverAccessToken: "driver-token",
2620+driverUserId: "@driver:matrix-qa.test",
2621+observedEvents: [],
2622+observerAccessToken: "observer-token",
2623+observerUserId: "@observer:matrix-qa.test",
2624+roomId: "!main:matrix-qa.test",
2625+restartGateway: undefined,
2626+syncState: {},
2627+sutAccessToken: "sut-token",
2628+sutUserId: "@sut:matrix-qa.test",
2629+timeoutMs: 8_000,
2630+topology: {
2631+defaultRoomId: "!main:matrix-qa.test",
2632+defaultRoomKey: "main",
2633+rooms: [],
26442634},
26452635});
2636+const artifacts = result.artifacts as {
2637+driverEventId?: unknown;
2638+previewEventId?: unknown;
2639+reply?: { eventId?: unknown };
2640+};
2641+expect(artifacts.driverEventId).toBe("$quiet-stream-trigger");
2642+expect(artifacts.previewEventId).toBe("$quiet-preview");
2643+expect(artifacts.reply?.eventId).toBe("$quiet-final");
2646264426472645expect(sendTextMessage).toHaveBeenCalledWith({
26482646body: expect.stringContaining("Quiet streaming QA check"),
26492647mentionUserIds: ["@sut:matrix-qa.test"],
26502648roomId: "!main:matrix-qa.test",
26512649});
2652-expect(waitForRoomEvent).toHaveBeenNthCalledWith(
2653-1,
2654-expect.objectContaining({
2655-since: "driver-sync-start",
2656-}),
2657-);
2658-expect(waitForRoomEvent).toHaveBeenNthCalledWith(
2659-2,
2660-expect.objectContaining({
2661-predicate: expect.any(Function),
2662-since: "driver-sync-preview",
2663-}),
2664-);
2650+expect(waitForRoomEvent.mock.calls[0]?.[0]?.since).toBe("driver-sync-start");
2651+const finalWaitOptions = waitForRoomEvent.mock.calls[1]?.[0];
2652+expect(typeof finalWaitOptions?.predicate).toBe("function");
2653+expect(finalWaitOptions?.since).toBe("driver-sync-preview");
26652654});
2666265526672656it("captures partial preview text messages before the finalized Matrix reply", async () => {
@@ -2699,15 +2688,15 @@ describe("matrix live qa scenarios", () => {
2699268827002689const scenario = requireMatrixQaScenario("matrix-room-partial-streaming-preview");
270126902702-await expect(runMatrixQaScenario(scenario, matrixQaScenarioContext())).resolves.toMatchObject({
2703- artifacts: {
2704- driverEventId: "$partial-stream-trigger",
2705- previewEventId: "$partial-preview",
2706- reply: {
2707- eventId: "$partial-final",
2708- },
2709- },
2710-});
2691+const result = await runMatrixQaScenario(scenario, matrixQaScenarioContext());
2692+const artifacts = result.artifacts as {
2693+driverEventId?: unknown;
2694+previewEventId?: unknown;
2695+reply?: { eventId?: unknown };
2696+};
2697+expect(artifacts.driverEventId).toBe("$partial-stream-trigger");
2698+expect(artifacts.previewEventId).toBe("$partial-preview");
2699+expect(artifacts.reply?.eventId).toBe("$partial-final");
2711270027122701expect(sendTextMessage).toHaveBeenCalledWith({
27132702body: expect.stringContaining("Partial streaming QA check"),
@@ -2750,16 +2739,19 @@ describe("matrix live qa scenarios", () => {
2750273927512740const scenario = requireMatrixQaScenario("matrix-room-tool-progress-preview");
275227412753-await expect(runMatrixQaScenario(scenario, matrixQaScenarioContext())).resolves.toMatchObject({
2754-artifacts: {
2755-driverEventId: "$tool-progress-trigger",
2756-previewBodyPreview: "Barnacling...\n`📖 Read: from /tmp/qa/workspace/QA_KICKOFF_TASK.md`",
2757-previewEventId: "$tool-progress-preview",
2758-reply: {
2759-eventId: "$tool-progress-final",
2760-},
2761-},
2762-});
2742+const result = await runMatrixQaScenario(scenario, matrixQaScenarioContext());
2743+const artifacts = result.artifacts as {
2744+driverEventId?: unknown;
2745+previewBodyPreview?: unknown;
2746+previewEventId?: unknown;
2747+reply?: { eventId?: unknown };
2748+};
2749+expect(artifacts.driverEventId).toBe("$tool-progress-trigger");
2750+expect(artifacts.previewBodyPreview).toBe(
2751+"Barnacling...\n`📖 Read: from /tmp/qa/workspace/QA_KICKOFF_TASK.md`",
2752+);
2753+expect(artifacts.previewEventId).toBe("$tool-progress-preview");
2754+expect(artifacts.reply?.eventId).toBe("$tool-progress-final");
27632755const prompt = String(sendTextMessage.mock.calls[0]?.[0]?.body);
27642756expect(prompt).toContain("use the read tool exactly once on `QA_KICKOFF_TASK.md`");
27652757expect(prompt).toContain("Do not read `HEARTBEAT.md`");
@@ -2812,16 +2804,17 @@ describe("matrix live qa scenarios", () => {
2812280428132805const scenario = requireMatrixQaScenario("matrix-room-tool-progress-preview");
281428062815-await expect(runMatrixQaScenario(scenario, matrixQaScenarioContext())).resolves.toMatchObject({
2816-artifacts: {
2817-driverEventId: "$tool-progress-generic-trigger",
2818-previewBodyPreview: "- `tool: exec_command`",
2819-previewEventId: "$tool-progress-generic-preview",
2820-reply: {
2821-eventId: "$tool-progress-generic-final",
2822-},
2823-},
2824-});
2807+const result = await runMatrixQaScenario(scenario, matrixQaScenarioContext());
2808+const artifacts = result.artifacts as {
2809+driverEventId?: unknown;
2810+previewBodyPreview?: unknown;
2811+previewEventId?: unknown;
2812+reply?: { eventId?: unknown };
2813+};
2814+expect(artifacts.driverEventId).toBe("$tool-progress-generic-trigger");
2815+expect(artifacts.previewBodyPreview).toBe("- `tool: exec_command`");
2816+expect(artifacts.previewEventId).toBe("$tool-progress-generic-preview");
2817+expect(artifacts.reply?.eventId).toBe("$tool-progress-generic-final");
28252818});
2826281928272820it("reports Matrix tool progress preview candidates when the progress wait times out", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。