attempted fix of lag

This commit is contained in:
Ryan Ward
2026-08-20 08:52:36 -05:00
parent 87080c8086
commit 32d969ea4f
5 changed files with 100 additions and 0 deletions
@@ -1129,6 +1129,23 @@ impl BlocklistAIActionExecutor {
}
}
/// Removes all per-conversation retained state from sub-executors.
/// Called when a conversation is removed or cleared from memory.
pub fn cleanup_conversation(
&mut self,
conversation_id: AIConversationId,
ctx: &mut ModelContext<Self>,
) {
self.restored_action_ids
.retain(|(conv_id, _)| *conv_id != conversation_id);
self.async_executing_actions
.0
.retain(|(conv_id, _), _| *conv_id != conversation_id);
self.run_agents_executor.update(ctx, |executor, _| {
executor.cleanup_conversation(conversation_id);
});
}
fn should_autoexecute(&self, input: ExecuteActionInput, ctx: &mut ModelContext<Self>) -> bool {
if self
.restored_action_ids