From d027b442af7e4842e35f06c85e0a31b409720d7b Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:32:20 -0500 Subject: [PATCH] fix(regression): restore zalouser cold-runtime chunking --- extensions/zalouser/src/channel.test.ts | 11 +++++++++++ extensions/zalouser/src/channel.ts | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extensions/zalouser/src/channel.test.ts b/extensions/zalouser/src/channel.test.ts index 6fa838a9690..47097e3d99b 100644 --- a/extensions/zalouser/src/channel.test.ts +++ b/extensions/zalouser/src/channel.test.ts @@ -110,6 +110,17 @@ describe("zalouser outbound", () => { }); }); +describe("zalouser outbound chunking", () => { + it("chunks outbound text without requiring Zalouser runtime initialization", () => { + const chunker = zalouserPlugin.outbound?.chunker; + if (!chunker) { + throw new Error("zalouser outbound.chunker unavailable"); + } + + expect(chunker("alpha beta", 5)).toEqual(["alpha", "beta"]); + }); +}); + describe("zalouser channel policies", () => { beforeEach(() => { mockSendReaction.mockClear(); diff --git a/extensions/zalouser/src/channel.ts b/extensions/zalouser/src/channel.ts index f4ce1ac0474..efe5367dc80 100644 --- a/extensions/zalouser/src/channel.ts +++ b/extensions/zalouser/src/channel.ts @@ -23,6 +23,7 @@ import type { } from "../runtime-api.js"; import { DEFAULT_ACCOUNT_ID, + chunkTextForOutbound, isDangerousNameMatchingEnabled, isNumericTargetId, normalizeAccountId, @@ -509,7 +510,7 @@ export const zalouserPlugin: ChannelPlugin getZalouserRuntime().channel.text.chunkMarkdownText(text, limit), + chunker: chunkTextForOutbound, chunkerMode: "markdown", sendPayload: async (ctx) => await sendPayloadWithChunkedTextAndMedia({