|
1 | 1 | import { describe, expect, test } from "bun:test"; |
2 | 2 | import { OPERATOR_ORIGINATED_FLAG } from "../agent/message-provenance.js"; |
3 | | -import { buildShellBackgroundMessage } from "../session/runtime-assembly.js"; |
| 3 | +import { |
| 4 | + buildFleetDryContinuationMessage, |
| 5 | + buildMailboxMailMessage, |
| 6 | + buildShellBackgroundMessage, |
| 7 | +} from "../session/runtime-assembly.js"; |
| 8 | +import { buildFleetDryContinuationPrompt } from "../subagent/fleet-dry-drive.js"; |
| 9 | +import { buildMailboxMailPrompt } from "../subagent/mailbox-mail-drive.js"; |
4 | 10 | import { suppressProviderFailurePresentation } from "./provider/failure-attempt.js"; |
5 | 11 | import { |
6 | 12 | createStreamMapContext, |
@@ -49,6 +55,45 @@ describe("mapProductionEvent", () => { |
49 | 55 | ).toEqual([{ type: "system", text: message.content ?? "" }]); |
50 | 56 | }); |
51 | 57 |
|
| 58 | + test("mailbox mail wake paints no transcript row", () => { |
| 59 | + const prompt = buildMailboxMailPrompt([ |
| 60 | + { agent_id: "w1", status: "done", report: "audit clean" }, |
| 61 | + ]); |
| 62 | + expect( |
| 63 | + mapProductionEvent({ |
| 64 | + type: "message.received", |
| 65 | + data: { message: buildMailboxMailMessage(prompt) }, |
| 66 | + }), |
| 67 | + ).toEqual([]); |
| 68 | + }); |
| 69 | + |
| 70 | + test("fleet-dry continuation paints no transcript row", () => { |
| 71 | + const prompt = buildFleetDryContinuationPrompt( |
| 72 | + [{ id: "t1", title: "ship it", status: "todo" }], |
| 73 | + [{ agent_id: "w1", status: "done" }], |
| 74 | + ); |
| 75 | + expect( |
| 76 | + mapProductionEvent({ |
| 77 | + type: "message.received", |
| 78 | + data: { message: buildFleetDryContinuationMessage(prompt) }, |
| 79 | + }), |
| 80 | + ).toEqual([]); |
| 81 | + }); |
| 82 | + |
| 83 | + test("operator-originated text matching a wake prefix still paints", () => { |
| 84 | + const content = buildMailboxMailPrompt([ |
| 85 | + { agent_id: "w1", status: "done" }, |
| 86 | + ]); |
| 87 | + expect( |
| 88 | + mapProductionEvent({ |
| 89 | + type: "message.received", |
| 90 | + data: { |
| 91 | + message: { content, flags: [OPERATOR_ORIGINATED_FLAG] }, |
| 92 | + }, |
| 93 | + }), |
| 94 | + ).toEqual([{ type: "user", text: content }]); |
| 95 | + }); |
| 96 | + |
52 | 97 | test("inference.start → busy run", () => { |
53 | 98 | expect(mapProductionEvent({ type: "inference.start" })).toEqual([ |
54 | 99 | { type: "attempt", action: "mark" }, |
|
0 commit comments