Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: use attachmentsRef.current in appendFiles early count check

[._.]/ Adam Eivy65f57d640479
diff --git a/client/src/hooks/useOpenClawAttachments.js b/client/src/hooks/useOpenClawAttachments.js
index 51e3fba6e5..a60a17b7fc 100644
--- a/client/src/hooks/useOpenClawAttachments.js
+++ b/client/src/hooks/useOpenClawAttachments.js
@@ -78,8 +78,7 @@ export function useOpenClawAttachments({ sending, onError = () => {} } = {}) {
if (!files || files.length === 0) return;
if (sending) return;
- const currentCount = Array.isArray(attachments) ? attachments.length : 0;
- const remainingSlots = MAX_ATTACHMENTS - currentCount;
+ const remainingSlots = MAX_ATTACHMENTS - attachmentsRef.current.length;
if (remainingSlots <= 0) {
onError(`You can attach up to ${MAX_ATTACHMENTS} files per message.`);