mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:58:28 +00:00
fix: thread replyToId and threadId through message tool send action (#14948)
* fix: thread replyToId and threadId through message tool send action * fix: omit replyToId/threadId from gateway send params * fix: add threading seam regression coverage (#14948) (thanks @mcaxtr) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -153,8 +153,10 @@ describe("runMessageAction threading auto-injection", () => {
|
||||
});
|
||||
|
||||
const call = mocks.executeSendAction.mock.calls[0]?.[0] as {
|
||||
threadId?: string;
|
||||
ctx?: { params?: Record<string, unknown> };
|
||||
};
|
||||
expect(call?.threadId).toBe("42");
|
||||
expect(call?.ctx?.params?.threadId).toBe("42");
|
||||
});
|
||||
|
||||
@@ -235,8 +237,40 @@ describe("runMessageAction threading auto-injection", () => {
|
||||
});
|
||||
|
||||
const call = mocks.executeSendAction.mock.calls[0]?.[0] as {
|
||||
threadId?: string;
|
||||
ctx?: { params?: Record<string, unknown> };
|
||||
};
|
||||
expect(call?.threadId).toBe("999");
|
||||
expect(call?.ctx?.params?.threadId).toBe("999");
|
||||
});
|
||||
|
||||
it("threads explicit replyTo through executeSendAction", async () => {
|
||||
mocks.executeSendAction.mockResolvedValue({
|
||||
handledBy: "plugin",
|
||||
payload: {},
|
||||
});
|
||||
|
||||
await runMessageAction({
|
||||
cfg: telegramConfig,
|
||||
action: "send",
|
||||
params: {
|
||||
channel: "telegram",
|
||||
target: "telegram:123",
|
||||
message: "hi",
|
||||
replyTo: "777",
|
||||
},
|
||||
toolContext: {
|
||||
currentChannelId: "telegram:123",
|
||||
currentThreadTs: "42",
|
||||
},
|
||||
agentId: "main",
|
||||
});
|
||||
|
||||
const call = mocks.executeSendAction.mock.calls[0]?.[0] as {
|
||||
replyToId?: string;
|
||||
ctx?: { params?: Record<string, unknown> };
|
||||
};
|
||||
expect(call?.replyToId).toBe("777");
|
||||
expect(call?.ctx?.params?.replyTo).toBe("777");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user