diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeAgent.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeAgent.cs index 8d5f18de..6fde9dce 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeAgent.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeAgent.cs @@ -37,9 +37,11 @@ public partial class RoutingService } else { - dialogs.Add(RoleDialogModel.From(message, + message = RoleDialogModel.From(message, role: AgentRole.Assistant, - content: response.Content)); + content: response.Content); + message.CurrentAgentId = agent.Id; + dialogs.Add(message); } return true;