Auto-reply: run inbound claims before core dispatch

This commit is contained in:
Vincent Koc 2026-03-15 15:57:03 -07:00
parent eaaaaaf465
commit 7666c7665a
1 changed files with 12 additions and 0 deletions

View File

@ -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(