test(perf): merge forum-topic direct-delivery scenarios

This commit is contained in:
Peter Steinberger
2026-03-02 15:17:28 +00:00
parent a469d00345
commit d212721df1

View File

@@ -14,7 +14,7 @@ describe("runCronIsolatedAgentTurn forum topic delivery", () => {
setupIsolatedAgentTurnMocks();
});
it("uses direct delivery for text-only forum topic targets", async () => {
it("routes forum-topic and plain telegram targets through the correct delivery path", async () => {
await withTempCronHome(async (home) => {
const storePath = await writeSessionStore(home, { lastProvider: "webchat", lastTo: "" });
const deps = createCliDeps();
@@ -38,23 +38,18 @@ describe("runCronIsolatedAgentTurn forum topic delivery", () => {
messageThreadId: 42,
}),
);
});
});
it("keeps text-only non-threaded targets on announce flow", async () => {
await withTempCronHome(async (home) => {
const storePath = await writeSessionStore(home, { lastProvider: "webchat", lastTo: "" });
const deps = createCliDeps();
vi.clearAllMocks();
mockAgentPayloads([{ text: "plain message" }]);
const res = await runTelegramAnnounceTurn({
const plainRes = await runTelegramAnnounceTurn({
home,
storePath,
deps,
delivery: { mode: "announce", channel: "telegram", to: "123" },
});
expect(res.status).toBe("ok");
expect(plainRes.status).toBe("ok");
expect(runSubagentAnnounceFlow).toHaveBeenCalledTimes(1);
const announceArgs = vi.mocked(runSubagentAnnounceFlow).mock.calls[0]?.[0] as
| { expectsCompletionMessage?: boolean }