From 7666c7665a5784bbe10e7df7e852da16cfdc892a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 15 Mar 2026 15:57:03 -0700 Subject: [PATCH] Auto-reply: run inbound claims before core dispatch --- src/auto-reply/reply/dispatch-from-config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/auto-reply/reply/dispatch-from-config.ts b/src/auto-reply/reply/dispatch-from-config.ts index 1e90dd58887..2bdbeb2d9b9 100644 --- a/src/auto-reply/reply/dispatch-from-config.ts +++ b/src/auto-reply/reply/dispatch-from-config.ts @@ -387,6 +387,18 @@ export async function dispatchReplyFromConfig(params: { } } + if (!pluginOwnedBinding && hookRunner?.hasHooks("inbound_claim")) { + const inboundClaimResult = await hookRunner.runInboundClaim( + inboundClaimEvent, + inboundClaimContext, + ); + if (inboundClaimResult?.handled) { + markIdle("plugin_inbound_claim"); + recordProcessed("completed", { reason: "plugin-inbound-claimed" }); + return { queuedFinal: false, counts: dispatcher.getQueuedCounts() }; + } + } + // Trigger plugin hooks (fire-and-forget) if (hookRunner?.hasHooks("message_received")) { fireAndForgetHook(