Skip to content

Agent Zero AI framework

fix: active chat detection

Nicolas Leãobb89b7ae7f6f
diff --git a/plugins/_chat_compaction/extensions/webui/chat-input-bottom-actions-start/compact-button.html b/plugins/_chat_compaction/extensions/webui/chat-input-bottom-actions-start/compact-button.html
index 7f7007546..0e145d339 100644
--- a/plugins/_chat_compaction/extensions/webui/chat-input-bottom-actions-start/compact-button.html
+++ b/plugins/_chat_compaction/extensions/webui/chat-input-bottom-actions-start/compact-button.html
@@ -6,18 +6,12 @@
<body>
<div x-data="{
get disabled() {
- const ctx = globalThis.getContext?.();
- const store = Alpine?.store?.('compactStore');
- const chatInput = Alpine?.store?.('chatInput');
- return !ctx || store?.compacting || chatInput?.running;
+ return !$store.chats?.selected || $store.compactStore?.compacting || $store.chatInput?.running;
},
get disabledReason() {
- const ctx = globalThis.getContext?.();
- const store = Alpine?.store?.('compactStore');
- const chatInput = Alpine?.store?.('chatInput');
- if (!ctx) return 'No active chat selected';
- if (store?.compacting) return 'Compaction in progress';
- if (chatInput?.running) return 'Cannot compact while agent is running';
+ if (!$store.chats?.selected) return 'No active chat selected';
+ if ($store.compactStore?.compacting) return 'Compaction in progress';
+ if ($store.chatInput?.running) return 'Cannot compact while agent is running';
return 'Compact chat history into a single summary';
}
}">