it("does not drop payloads that merely start with the silent token", async () => { const res = await routeReply({
payload: { text: `${SILENT_REPLY_TOKEN} -- (why am I here?)` },
channel: "slack",
to: "channel:C123",
cfg: {} as never,
});
expect(res.ok).toBe(true);
expectLastDelivery({
channel: "slack",
to: "channel:C123",
payloads: [
expect.objectContaining({
text: `${SILENT_REPLY_TOKEN} -- (why am I here?)`,
}),
],
});
});
it("passes policySessionKey through to outbound delivery targets", async () => { const cfg = {
agents: {
defaults: {
silentReply: {
direct: "disallow",
group: "allow",
internal: "allow",
},
silentReplyRewrite: {
direct: true,
},
},
},
} as unknown as OpenClawConfig;
it("uses replyToId as threadTs for Slack", async () => {
await routeReply({
payload: { text: "hi", replyToId: "1710000000.0001" },
channel: "slack",
to: "channel:C123",
cfg: {} as never,
});
expectLastDelivery({
channel: "slack",
replyToId: "1710000000.0001",
threadId: null,
});
});
it("uses threadId as threadTs for Slack when replyToId is missing", async () => {
await routeReply({
payload: { text: "hi" },
channel: "slack",
to: "channel:C123",
threadId: "1710000000.9999",
cfg: {} as never,
});
expectLastDelivery({
channel: "slack",
replyToId: "1710000000.9999",
threadId: null,
});
});
it("uses Slack threadId when routed replyToId is an internal message id", async () => {
await routeReply({
payload: { text: "hi", replyToId: "msg-internal-1" },
channel: "slack",
to: "channel:C123",
threadId: "1710000000.9999",
cfg: {} as never,
});
expectLastDelivery({
channel: "slack",
replyToId: "1710000000.9999",
threadId: null,
});
});
it("uses threadId as replyToId for Mattermost when replyToId is missing", async () => {
await routeReply({
payload: { text: "hi" },
channel: "mattermost",
to: "channel:CHAN1",
threadId: "post-root",
cfg: {
channels: {
mattermost: {
enabled: true,
botToken: "test-token",
baseUrl: "https://chat.example.com",
},
},
} as unknown as OpenClawConfig,
});
expectLastDelivery({
channel: "mattermost",
to: "channel:CHAN1",
replyToId: "post-root",
threadId: "post-root",
});
});
it("preserves multiple mediaUrls as a single outbound payload", async () => {
await routeReply({
payload: { text: "caption", mediaUrls: ["a", "b"] },
channel: "slack",
to: "channel:C123",
cfg: {} as never,
});
expectLastDelivery({
channel: "slack",
payloads: [
expect.objectContaining({
text: "caption",
mediaUrls: ["a", "b"],
}),
],
});
});
it("routes WhatsApp with the account id intact", async () => {
await routeReply({
payload: { text: "hi" },
channel: "whatsapp",
to: "+15551234567",
accountId: "acc-1",
cfg: {} as never,
});
expectLastDelivery({
channel: "whatsapp",
to: "+15551234567",
accountId: "acc-1",
});
});
it("routes MS Teams via outbound delivery", async () => { const cfg = {
channels: {
msteams: {
enabled: true,
},
},
} as unknown as OpenClawConfig;
await routeReply({
payload: { text: "hi" },
channel: "msteams",
to: "conversation:19:abc@thread.tacv2",
cfg,
});
expectLastDelivery({
channel: "msteams",
to: "conversation:19:abc@thread.tacv2",
cfg,
payloads: [expect.objectContaining({ text: "hi" })],
});
});
it("passes mirror data when sessionKey is set", async () => {
await routeReply({
payload: { text: "hi" },
channel: "slack",
to: "channel:C123",
sessionKey: "agent:main:main",
isGroup: true,
groupId: "channel:C123",
cfg: {} as never,
});
expectLastDelivery({
mirror: expect.objectContaining({
sessionKey: "agent:main:main",
text: "hi",
isGroup: true,
groupId: "channel:C123",
}),
});
});
it("skips mirror data when mirror is false", async () => {
await routeReply({
payload: { text: "hi" },
channel: "slack",
to: "channel:C123",
sessionKey: "agent:main:main",
mirror: false,
cfg: {} as never,
});
expectLastDelivery({
mirror: undefined,
});
});
});
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.20Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.