fix(regression): restore zalouser cold-runtime chunking

This commit is contained in:
Tak Hoffman
2026-03-27 21:32:20 -05:00
parent 05719648a1
commit d027b442af
2 changed files with 13 additions and 1 deletions

View File

@@ -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();

View File

@@ -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<ResolvedZalouserAccount, ZalouserProb
},
outbound: {
deliveryMode: "direct",
chunker: (text, limit) => getZalouserRuntime().channel.text.chunkMarkdownText(text, limit),
chunker: chunkTextForOutbound,
chunkerMode: "markdown",
sendPayload: async (ctx) =>
await sendPayloadWithChunkedTextAndMedia({