File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -1157,6 +1157,29 @@ describe('prepareToolExecution', () => {
11571157 expect ( toolParams . channel ) . toBe ( '#general' ) // User value wins
11581158 expect ( toolParams . message ) . toBe ( 'Hello' )
11591159 } )
1160+
1161+ it . concurrent ( 'should preserve 0 and false as valid user values in inputMapping' , ( ) => {
1162+ const tool = {
1163+ params : {
1164+ workflowId : 'child-workflow' ,
1165+ inputMapping : '{"limit": 0, "enabled": false, "query": ""}' ,
1166+ } ,
1167+ }
1168+ const llmArgs = {
1169+ inputMapping : { limit : 10 , enabled : true , query : 'llm-search' } ,
1170+ }
1171+ const request = { }
1172+
1173+ const { toolParams } = prepareToolExecution ( tool , llmArgs , request )
1174+
1175+ // 0 and false should be preserved (they're valid values)
1176+ // empty string should be filled by LLM
1177+ expect ( toolParams . inputMapping ) . toEqual ( {
1178+ limit : 0 ,
1179+ enabled : false ,
1180+ query : 'llm-search' ,
1181+ } )
1182+ } )
11601183 } )
11611184
11621185 describe ( 'execution params context' , ( ) => {
Original file line number Diff line number Diff line change @@ -520,6 +520,26 @@ describe('Tool Parameters Utils', () => {
520520 expect ( merged . channel ) . toBe ( '#general' )
521521 expect ( merged . message ) . toBe ( 'Hello world' )
522522 } )
523+
524+ it . concurrent ( 'should preserve 0 and false as valid user values in inputMapping' , ( ) => {
525+ const userProvided = {
526+ workflowId : 'workflow-123' ,
527+ inputMapping : '{"limit": 0, "enabled": false, "query": ""}' ,
528+ }
529+ const llmGenerated = {
530+ inputMapping : { limit : 10 , enabled : true , query : 'llm-search' } ,
531+ }
532+
533+ const merged = mergeToolParameters ( userProvided , llmGenerated )
534+
535+ // 0 and false should be preserved (they're valid values)
536+ // empty string should be filled by LLM
537+ expect ( merged . inputMapping ) . toEqual ( {
538+ limit : 0 ,
539+ enabled : false ,
540+ query : 'llm-search' ,
541+ } )
542+ } )
523543 } )
524544 } )
525545
You can’t perform that action at this time.
0 commit comments