File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
apps/sim/lib/workflows/comparison Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -645,6 +645,18 @@ describe('Workflow Normalization Utilities', () => {
645645 const result = filterSubBlockIds ( ids )
646646 expect ( result ) . toEqual ( [ 'signingSecret' ] )
647647 } )
648+
649+ it . concurrent ( 'should exclude synthetic tool-input subBlock IDs' , ( ) => {
650+ const ids = [
651+ 'toolConfig' ,
652+ 'toolConfig-tool-0-query' ,
653+ 'toolConfig-tool-0-url' ,
654+ 'toolConfig-tool-1-status' ,
655+ 'systemPrompt' ,
656+ ]
657+ const result = filterSubBlockIds ( ids )
658+ expect ( result ) . toEqual ( [ 'systemPrompt' , 'toolConfig' ] )
659+ } )
648660 } )
649661
650662 describe ( 'normalizeTriggerConfigValues' , ( ) => {
Original file line number Diff line number Diff line change @@ -411,7 +411,14 @@ export function extractBlockFieldsForComparison(block: BlockState): ExtractedBlo
411411}
412412
413413/**
414- * Filters subBlock IDs to exclude system and trigger runtime subBlocks.
414+ * Pattern matching synthetic subBlock IDs created by ToolSubBlockRenderer.
415+ * These IDs follow the format `{subBlockId}-tool-{index}-{paramId}` and are
416+ * mirrors of values already stored in toolConfig.value.tools[N].params.
417+ */
418+ const SYNTHETIC_TOOL_SUBBLOCK_RE = / - t o o l - \d + - /
419+
420+ /**
421+ * Filters subBlock IDs to exclude system, trigger runtime, and synthetic tool subBlocks.
415422 *
416423 * @param subBlockIds - Array of subBlock IDs to filter
417424 * @returns Filtered and sorted array of subBlock IDs
@@ -422,6 +429,7 @@ export function filterSubBlockIds(subBlockIds: string[]): string[] {
422429 if ( TRIGGER_RUNTIME_SUBBLOCK_IDS . includes ( id ) ) return false
423430 if ( SYSTEM_SUBBLOCK_IDS . some ( ( sysId ) => id === sysId || id . startsWith ( `${ sysId } _` ) ) )
424431 return false
432+ if ( SYNTHETIC_TOOL_SUBBLOCK_RE . test ( id ) ) return false
425433 return true
426434 } )
427435 . sort ( )
You can’t perform that action at this time.
0 commit comments