mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:10:45 +00:00
fix(auto-reply): run message_sending before inbound delivery
Run inbound auto-reply delivery through message_sending hooks before sending replies. Co-authored-by: Jamil Zakirov <15848838+jzakirov@users.noreply.github.com>
This commit is contained in:
@@ -427,6 +427,9 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
);
|
||||
expect(dispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
dispatcherOptions: expect.objectContaining({
|
||||
beforeDeliver: expect.any(Function),
|
||||
}),
|
||||
replyOptions: expect.objectContaining({
|
||||
disableBlockStreaming: true,
|
||||
}),
|
||||
|
||||
@@ -761,6 +761,7 @@ export const dispatchTelegramMessage = async ({
|
||||
cfg,
|
||||
dispatcherOptions: {
|
||||
...replyPipeline,
|
||||
beforeDeliver: async (payload) => payload,
|
||||
deliver: async (payload, info) => {
|
||||
if (isDispatchSuperseded()) {
|
||||
return;
|
||||
|
||||
@@ -449,6 +449,9 @@ describe("registerTelegramNativeCommands — session metadata", () => {
|
||||
await runPromise;
|
||||
|
||||
expect(replyMocks.dispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalledTimes(1);
|
||||
expect(
|
||||
replyMocks.dispatchReplyWithBufferedBlockDispatcher.mock.calls[0]?.[0].dispatcherOptions,
|
||||
).toEqual(expect.objectContaining({ beforeDeliver: expect.any(Function) }));
|
||||
});
|
||||
|
||||
it("does not inject approval buttons for native command replies once the monitor owns approvals", async () => {
|
||||
|
||||
@@ -940,6 +940,7 @@ export const registerTelegramNativeCommands = ({
|
||||
cfg: executionCfg,
|
||||
dispatcherOptions: {
|
||||
...replyPipeline,
|
||||
beforeDeliver: async (payload) => payload,
|
||||
deliver: async (payload, _info) => {
|
||||
if (
|
||||
shouldSuppressLocalTelegramExecApprovalPrompt({
|
||||
|
||||
Reference in New Issue
Block a user