mirror of https://github.com/openclaw/openclaw.git
fix(regression): restore zalouser cold-runtime chunking
This commit is contained in:
parent
05719648a1
commit
d027b442af
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue