@@ -34,6 +34,7 @@ async function main() {
3434
3535 // Extract mentions configuration from validation config
3636 const mentionsConfig = validationConfig ?. mentions || null ;
37+ const maxMentions = parseIntTemplatable ( mentionsConfig ?. max , 50 ) ;
3738
3839 // Resolve allowed mentions for the output collector
3940 // This determines which @mentions are allowed in the agent output
@@ -43,7 +44,7 @@ async function main() {
4344 /** @type {number | undefined } */
4445 let maxBotMentions ;
4546
46- function validateFieldWithInputSchema ( value , fieldName , inputSchema , lineNum ) {
47+ function validateFieldWithInputSchema ( value , fieldName , inputSchema , lineNum , allowedAliasesSeen ) {
4748 if ( inputSchema . required && ( value === undefined || value === null ) ) {
4849 return {
4950 isValid : false ,
@@ -66,7 +67,7 @@ async function main() {
6667 error : `Line ${ lineNum } : ${ fieldName } must be a string` ,
6768 } ;
6869 }
69- normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxBotMentions } ) ;
70+ normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxMentions , maxBotMentions, allowedAliasesSeen } ) ;
7071 break ;
7172 case "boolean" :
7273 if ( typeof value !== "boolean" ) {
@@ -97,11 +98,11 @@ async function main() {
9798 error : `Line ${ lineNum } : ${ fieldName } must be one of: ${ inputSchema . options . join ( ", " ) } ` ,
9899 } ;
99100 }
100- normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxBotMentions } ) ;
101+ normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxMentions , maxBotMentions, allowedAliasesSeen } ) ;
101102 break ;
102103 default :
103104 if ( typeof value === "string" ) {
104- normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxBotMentions } ) ;
105+ normalizedValue = sanitizeContent ( value , { allowedAliases : allowedMentions , maxMentions , maxBotMentions, allowedAliasesSeen } ) ;
105106 }
106107 break ;
107108 }
@@ -120,9 +121,10 @@ async function main() {
120121 normalizedItem,
121122 } ;
122123 }
124+ const allowedAliasesSeen = new Set ( ) ;
123125 for ( const [ fieldName , inputSchema ] of Object . entries ( jobConfig . inputs ) ) {
124126 const fieldValue = item [ fieldName ] ;
125- const validation = validateFieldWithInputSchema ( fieldValue , fieldName , inputSchema , lineNum ) ;
127+ const validation = validateFieldWithInputSchema ( fieldValue , fieldName , inputSchema , lineNum , allowedAliasesSeen ) ;
126128 if ( ! validation . isValid && validation . error ) {
127129 errors . push ( validation . error ) ;
128130 } else if ( validation . normalizedValue !== undefined ) {
@@ -357,6 +359,7 @@ async function main() {
357359 if ( hasValidationConfig ( itemType ) ) {
358360 const validationResult = validateItem ( item , itemType , i + 1 , {
359361 allowedAliases : allowedMentions ,
362+ maxMentions,
360363 maxBotMentions,
361364 normalizeIssueClosingKeywords,
362365 dataEnabled : typeConfig !== null && typeof typeConfig === "object" && typeConfig . data_enabled === true ,
0 commit comments