mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 08:07:27 +00:00
Mattermost: close reply delivery review gaps for openclaw#44021 thanks @LyleLiu666
This commit is contained in:
@@ -1002,6 +1002,7 @@ export async function monitorMattermostProvider(opts: MonitorMattermostOpts = {}
|
|||||||
replyToId: trimmedPayload.replyToId,
|
replyToId: trimmedPayload.replyToId,
|
||||||
}),
|
}),
|
||||||
textLimit,
|
textLimit,
|
||||||
|
// The picker path already converts and trims text before capture/delivery.
|
||||||
tableMode: "off",
|
tableMode: "off",
|
||||||
sendMessage: sendMessageMattermost,
|
sendMessage: sendMessageMattermost,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,4 +60,36 @@ describe("deliverMattermostReplyPayload", () => {
|
|||||||
await fs.rm(stateDir, { recursive: true, force: true });
|
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",
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user