From f366b557d555f9e2b2abeeca9577dd92844cea2c Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 8 Feb 2025 11:22:32 -0800 Subject: [PATCH] Fixed small bug that didn't render tools in agent blocks --- stores/workflow/store.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/stores/workflow/store.ts b/stores/workflow/store.ts index 89eb8288d5..f2cb2e4d21 100644 --- a/stores/workflow/store.ts +++ b/stores/workflow/store.ts @@ -84,7 +84,17 @@ export const useWorkflowStore = create()( ...block.subBlocks, [subBlockId]: { ...block.subBlocks[subBlockId], - value: typeof value === 'string' ? value : JSON.stringify(value, null, 2), + value: + // Keep tools as arrays + subBlockId === 'tools' && Array.isArray(value) + ? value + : // Keep responseFormat as string + subBlockId === 'responseFormat' + ? value + : // For all other values, use the previous logic of stringifying + typeof value === 'string' + ? value + : JSON.stringify(value, null, 2), }, }