Mattermost: close reply delivery review gaps for openclaw#44021 thanks @LyleLiu666

This commit is contained in:
Muhammed Mukhthar CM 2026-03-12 13:58:55 +00:00
parent ca3df1495f
commit 856f11f129
2 changed files with 33 additions and 0 deletions

View File

@ -1002,6 +1002,7 @@ export async function monitorMattermostProvider(opts: MonitorMattermostOpts = {}
replyToId: trimmedPayload.replyToId,
}),
textLimit,
// The picker path already converts and trims text before capture/delivery.
tableMode: "off",
sendMessage: sendMessageMattermost,
});

View File

@ -60,4 +60,36 @@ describe("deliverMattermostReplyPayload", () => {
await fs.rm(stateDir, { recursive: true, force: true });
}
});
it("forwards replyToId for text-only chunked replies", async () => {
const sendMessage = vi.fn(async () => undefined);
const core = {
channel: {
text: {
convertMarkdownTables: vi.fn((text: string) => text),
resolveChunkMode: vi.fn(() => "length"),
chunkMarkdownTextWithMode: vi.fn(() => ["hello"]),
},
},
} as any;
await deliverMattermostReplyPayload({
core,
cfg: {} satisfies OpenClawConfig,
payload: { text: "hello" },
to: "channel:town-square",
accountId: "default",
agentId: "agent-1",
replyToId: "root-post",
textLimit: 4000,
tableMode: "off",
sendMessage,
});
expect(sendMessage).toHaveBeenCalledTimes(1);
expect(sendMessage).toHaveBeenCalledWith("channel:town-square", "hello", {
accountId: "default",
replyToId: "root-post",
});
});
});