mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 03:11:10 +00:00
fix(regression): restore zalouser cold-runtime chunking
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user