mirror of https://github.com/openclaw/openclaw.git
fix(regression): restore signal cold-runtime chunking
This commit is contained in:
parent
bd7375f84a
commit
42ecfffbff
|
|
@ -18,6 +18,7 @@ import { resolveSignalOutboundTarget } from "./outbound-session.js";
|
|||
import { probeSignal, type SignalProbe } from "./probe.js";
|
||||
import {
|
||||
buildBaseChannelStatusSummary,
|
||||
chunkText,
|
||||
collectStatusIssuesFromLastError,
|
||||
createDefaultChannelRuntimeState,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
|
|
@ -306,7 +307,7 @@ export const signalPlugin: ChannelPlugin<ResolvedSignalAccount, SignalProbe> =
|
|||
outbound: {
|
||||
base: {
|
||||
deliveryMode: "direct",
|
||||
chunker: (text, limit) => getSignalRuntime().channel.text.chunkText(text, limit),
|
||||
chunker: chunkText,
|
||||
chunkerMode: "text",
|
||||
textChunkLimit: 4000,
|
||||
sendFormattedText: async ({ cfg, to, text, accountId, deps, abortSignal }) =>
|
||||
|
|
|
|||
|
|
@ -131,6 +131,18 @@ describe("probeSignal", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("signal outbound", () => {
|
||||
it("chunks outbound text without requiring Signal runtime initialization", () => {
|
||||
clearSignalRuntime();
|
||||
const chunker = signalPlugin.outbound?.chunker;
|
||||
if (!chunker) {
|
||||
throw new Error("signal outbound.chunker unavailable");
|
||||
}
|
||||
|
||||
expect(chunker("alpha beta", 5)).toEqual(["alpha", "beta"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("classifySignalCliLogLine", () => {
|
||||
it("treats INFO/DEBUG as log", () => {
|
||||
expect(classifySignalCliLogLine("INFO DaemonCommand - Started")).toBe("log");
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export { SignalConfigSchema } from "../config/zod-schema.providers-core.js";
|
|||
|
||||
export { normalizeE164 } from "../utils.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export { chunkText } from "../auto-reply/chunk.js";
|
||||
export {
|
||||
createCliPathTextInput,
|
||||
createDelegatedTextInputShouldPrompt,
|
||||
|
|
|
|||
Loading…
Reference in New Issue