mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 03:41:51 +00:00
fix(regression): restore googlechat cold-runtime chunking
This commit is contained in:
@@ -102,6 +102,15 @@ function setupRuntimeMediaMocks(params: { loadFileName: string; loadBytes: strin
|
||||
}
|
||||
|
||||
describe("googlechatPlugin outbound sendMedia", () => {
|
||||
it("chunks outbound text without requiring Google Chat runtime initialization", () => {
|
||||
const chunker = googlechatPlugin.outbound?.chunker;
|
||||
if (!chunker) {
|
||||
throw new Error("Expected googlechatPlugin.outbound.chunker to be defined");
|
||||
}
|
||||
|
||||
expect(chunker("alpha beta", 5)).toEqual(["alpha", "beta"]);
|
||||
});
|
||||
|
||||
it("loads local media with mediaLocalRoots via runtime media loader", async () => {
|
||||
const { loadWebMedia, fetchRemoteMedia } = setupRuntimeMediaMocks({
|
||||
loadFileName: "image.png",
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
} from "openclaw/plugin-sdk/status-helpers";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
chunkTextForOutbound,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
createAccountStatusSink,
|
||||
getChatChannelMeta,
|
||||
@@ -349,7 +350,7 @@ export const googlechatPlugin = createChatChannelPlugin({
|
||||
outbound: {
|
||||
base: {
|
||||
deliveryMode: "direct",
|
||||
chunker: (text, limit) => getGoogleChatRuntime().channel.text.chunkMarkdownText(text, limit),
|
||||
chunker: chunkTextForOutbound,
|
||||
chunkerMode: "markdown",
|
||||
textChunkLimit: 4000,
|
||||
resolveTarget: ({ to }) => {
|
||||
|
||||
@@ -27,6 +27,7 @@ export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
|
||||
export { fetchRemoteMedia } from "../media/fetch.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export { loadWebMedia } from "./web-media.js";
|
||||
export { chunkTextForOutbound } from "./text-chunking.js";
|
||||
export {
|
||||
addWildcardAllowFrom,
|
||||
mergeAllowFromEntries,
|
||||
|
||||
Reference in New Issue
Block a user