@@ -3938,6 +3938,50 @@ describe("matrix live qa scenarios", () => {
|
3938 | 3938 | expect(prompt).toContain("The QA harness must observe that failed read"); |
3939 | 3939 | }); |
3940 | 3940 | |
| 3941 | +it("rejects active Matrix mentions in final-first tool-progress previews", async () => { |
| 3942 | +const { sendTextMessage } = mockMatrixQaRoomClient({ |
| 3943 | +driverEventId: "$tool-progress-mention-final-first-trigger", |
| 3944 | +events: [ |
| 3945 | +{ |
| 3946 | +event: ({ sendTextMessage }) => |
| 3947 | +matrixQaMessageEvent({ |
| 3948 | +kind: "message", |
| 3949 | +eventId: "$tool-progress-mention-final-first-final", |
| 3950 | +body: readMatrixQaReplyDirective( |
| 3951 | +mockMessageBody(sendTextMessage, "sendTextMessage"), |
| 3952 | +"MATRIX_QA_TOOL_PROGRESS_MENTION_SAFE_FIXED", |
| 3953 | +), |
| 3954 | +}), |
| 3955 | +since: "driver-sync-final", |
| 3956 | +}, |
| 3957 | +{ |
| 3958 | +event: matrixQaMessageEvent({ |
| 3959 | +kind: "message", |
| 3960 | +eventId: "$tool-progress-mention-final-first-progress", |
| 3961 | +body: |
| 3962 | +"Working...\n- `read matrix-progress-@room-@alice:matrix-qa.test-!room:matrix-qa.test.txt failed`", |
| 3963 | +formattedBody: |
| 3964 | +"Working...<br><ul><li><code>read matrix-progress-@room-@alice:matrix-qa.test-!room:matrix-qa.test.txt failed</code></li></ul>", |
| 3965 | +mentions: { |
| 3966 | +room: true, |
| 3967 | +userIds: ["@alice:matrix-qa.test"], |
| 3968 | +}, |
| 3969 | +}), |
| 3970 | +since: "driver-sync-progress", |
| 3971 | +}, |
| 3972 | +], |
| 3973 | +}); |
| 3974 | + |
| 3975 | +const scenario = requireMatrixQaScenario("matrix-room-tool-progress-mention-safety"); |
| 3976 | + |
| 3977 | +await expect(runMatrixQaScenario(scenario, matrixQaScenarioContext())).rejects.toThrow( |
| 3978 | +/active mentions/, |
| 3979 | +); |
| 3980 | +expect(mockMessageBody(sendTextMessage, "sendTextMessage")).toContain( |
| 3981 | +"read the missing workspace file", |
| 3982 | +); |
| 3983 | +}); |
| 3984 | + |
3941 | 3985 | it("preserves separate finalized block events when Matrix block streaming is enabled", async () => { |
3942 | 3986 | const primeRoom = vi.fn().mockResolvedValue("driver-sync-start"); |
3943 | 3987 | const sendTextMessage = vi.fn().mockResolvedValue("$block-stream-trigger"); |
|