From 656b5335234f14fe357e1ff377ec49204b64d2c5 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Mon, 11 Mar 2024 09:49:17 -0500 Subject: [PATCH] Emit OnRoutingInstructionRevised --- .../Routing/Handlers/RouteToAgentRoutingHandler.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs b/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs index b21250db..ea020fd3 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/Handlers/RouteToAgentRoutingHandler.cs @@ -47,10 +47,11 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler if (!string.IsNullOrEmpty(goalAgent)) { inst.OriginalAgent = goalAgent; + // Emit hook + await HookEmitter.Emit(_services, async hook => + await hook.OnRoutingInstructionRevised(inst, message) + ); } - await HookEmitter.Emit(_services, async hook => - await hook.OnRoutingInstructionRevised(inst, message) - ); var agentId = routing.Context.GetCurrentAgentId();