File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
backend/src/tools/handlers/tool Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,11 @@ export async function executeAgent({
319319} ) {
320320 const width = 60
321321 const fullAgentName = `${ agentTemplate . displayName } (${ agentTemplate . id } )`
322- const dashes = '-' . repeat ( Math . floor ( ( width - fullAgentName . length - 2 ) / 2 ) )
322+ const dashesLength = Math . max (
323+ 0 ,
324+ Math . floor ( ( width - fullAgentName . length - 2 ) / 2 ) ,
325+ )
326+ const dashes = '-' . repeat ( dashesLength )
323327
324328 // Send agent start notification if this is the only child
325329 if ( isOnlyChild ) {
@@ -347,9 +351,11 @@ export async function executeAgent({
347351 // Send agent end notification if this is the only child
348352 if ( isOnlyChild ) {
349353 const endedFullAgentName = `Completed: ${ fullAgentName } `
350- const dashesForEndedAgent = '-' . repeat (
351- Math . floor ( width - endedFullAgentName . length - 2 ) / 2 ,
354+ const dashesLength = Math . max (
355+ 0 ,
356+ Math . floor ( ( width - endedFullAgentName . length - 2 ) / 2 ) ,
352357 )
358+ const dashesForEndedAgent = '-' . repeat ( dashesLength )
353359 onResponseChunk (
354360 `\n\n${ dashesForEndedAgent } ${ endedFullAgentName } ${ dashesForEndedAgent } \n\n` ,
355361 )
You can’t perform that action at this time.
0 commit comments