diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx index acbb30ff20..1e745f3f28 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx @@ -78,9 +78,10 @@ const CopilotMessage: FC = memo( mode, setMode, isAborting, - maskCredentialValue, } = useCopilotStore() + const maskCredentialValue = useCopilotStore((s) => s.maskCredentialValue) + const messageCheckpoints = isUser ? allMessageCheckpoints[message.id] || [] : [] const hasCheckpoints = messageCheckpoints.length > 0 && messageCheckpoints.some((cp) => cp?.id) @@ -265,7 +266,7 @@ const CopilotMessage: FC = memo( } return null }) - }, [message.contentBlocks, isActivelyStreaming, parsedTags, isLastMessage, maskCredentialValue]) + }, [message.contentBlocks, isActivelyStreaming, parsedTags, isLastMessage]) if (isUser) { return ( diff --git a/apps/sim/stores/panel/copilot/store.ts b/apps/sim/stores/panel/copilot/store.ts index 5068cd1673..10d66b3984 100644 --- a/apps/sim/stores/panel/copilot/store.ts +++ b/apps/sim/stores/panel/copilot/store.ts @@ -2737,11 +2737,16 @@ export const useCopilotStore = create()( })) } - // Load sensitive credential IDs for masking before streaming starts - await get().loadSensitiveCredentialIds() - - // Ensure auto-allowed tools are loaded before tool calls arrive - await get().loadAutoAllowedTools() + get() + .loadSensitiveCredentialIds() + .catch((err) => { + logger.warn('[Copilot] Failed to load sensitive credential IDs', err) + }) + get() + .loadAutoAllowedTools() + .catch((err) => { + logger.warn('[Copilot] Failed to load auto-allowed tools', err) + }) let newMessages: CopilotMessage[] if (revertState) {