Skip to content

Commit 1aa9814

Browse files
committed
fix: release cancellation map guard before cancel
1 parent 28a0444 commit 1aa9814

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/agent/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,11 @@ impl ActorLogic<BusMessage> for AgentLogic {
19921992
// Keep ownership registered until the reasoning task emits its
19931993
// terminal lifecycle event and finalizes. New inbound arriving
19941994
// during cancellation must queue behind that acknowledgement.
1995-
if let Some(token) = self.cancellation_tokens.get(&chat_id) {
1995+
if let Some(token) = self
1996+
.cancellation_tokens
1997+
.get(&chat_id)
1998+
.map(|entry| entry.value().clone())
1999+
{
19962000
token.cancel();
19972001
let _ = self.logger_tx.send(BusMessage::Log(
19982002
LogEvent::info(

0 commit comments

Comments
 (0)