Fix Pop agent bug.

This commit is contained in:
Haiping Chen 2024-02-28 20:41:21 -06:00
parent 888eaa8191
commit 0f6a183ed4
2 changed files with 2 additions and 4 deletions

View file

@ -1,7 +1,4 @@
using BotSharp.Abstraction.Functions;
using BotSharp.Abstraction.Repositories;
using BotSharp.Abstraction.Repositories.Filters;
using BotSharp.Abstraction.Routing;
using BotSharp.Abstraction.Routing.Models;
using System.Drawing;

View file

@ -80,9 +80,10 @@ public class RoutingContext : IRoutingContext
}
var agentId = _stack.Pop();
var currentAgentId = GetCurrentAgentId();
HookEmitter.Emit<IRoutingHook>(_services, async hook =>
await hook.OnAgentDequeued(agentId, _stack.Peek(), reason: reason)
await hook.OnAgentDequeued(agentId, currentAgentId, reason: reason)
).Wait();
}