Skip to content

Commit 2329468

Browse files
authored
fix(copilot): mask credentials fix (#2963)
* Fix copilot masking * Clean up * Lint
1 parent b913cff commit 2329468

File tree

2 files changed

+13
-7
lines changed
  • apps/sim
    • app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message
    • stores/panel/copilot

2 files changed

+13
-7
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
7878
mode,
7979
setMode,
8080
isAborting,
81-
maskCredentialValue,
8281
} = useCopilotStore()
8382

83+
const maskCredentialValue = useCopilotStore((s) => s.maskCredentialValue)
84+
8485
const messageCheckpoints = isUser ? allMessageCheckpoints[message.id] || [] : []
8586
const hasCheckpoints = messageCheckpoints.length > 0 && messageCheckpoints.some((cp) => cp?.id)
8687

@@ -265,7 +266,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
265266
}
266267
return null
267268
})
268-
}, [message.contentBlocks, isActivelyStreaming, parsedTags, isLastMessage, maskCredentialValue])
269+
}, [message.contentBlocks, isActivelyStreaming, parsedTags, isLastMessage])
269270

270271
if (isUser) {
271272
return (

apps/sim/stores/panel/copilot/store.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,11 +2737,16 @@ export const useCopilotStore = create<CopilotStore>()(
27372737
}))
27382738
}
27392739

2740-
// Load sensitive credential IDs for masking before streaming starts
2741-
await get().loadSensitiveCredentialIds()
2742-
2743-
// Ensure auto-allowed tools are loaded before tool calls arrive
2744-
await get().loadAutoAllowedTools()
2740+
get()
2741+
.loadSensitiveCredentialIds()
2742+
.catch((err) => {
2743+
logger.warn('[Copilot] Failed to load sensitive credential IDs', err)
2744+
})
2745+
get()
2746+
.loadAutoAllowedTools()
2747+
.catch((err) => {
2748+
logger.warn('[Copilot] Failed to load auto-allowed tools', err)
2749+
})
27452750

27462751
let newMessages: CopilotMessage[]
27472752
if (revertState) {

0 commit comments

Comments
 (0)