@@ -56,7 +56,7 @@ class Agent {
5656
5757 this . tools = [
5858 ...this . tools ,
59- ...( mentaionedMCPSTool || [ ] ) ,
59+ ...mentaionedMCPSTool || [ ] ,
6060
6161 ]
6262 let mentionedAgents = await task . userMessage . getMentionedAgents ( ) ;
@@ -155,12 +155,9 @@ class Agent {
155155
156156 }
157157 else {
158- console . log ( "Executing tool: " , toolName , toolInput ) ;
159158 const [ didUserReject , result ] = await this . executeTool ( toolName , toolInput ) ;
160- console . log ( "Tool result: " , result ) ;
161159 // toolResults.push(this.getToolResult(toolUseId, result));
162160 let toolResult = this . getToolResult ( toolUseId , result )
163-
164161 toolResults . push ( {
165162 role : "tool" ,
166163 tool_call_id : toolResult . tool_call_id ,
@@ -223,7 +220,7 @@ class Agent {
223220 toolResults . push ( {
224221 role : "tool" ,
225222 tool_call_id : toolResult . tool_call_id ,
226- content : toolResult . content ?. trim ( ) ? toolResult . content : "Tool executed successfully." ,
223+ content : toolResult . content ,
227224
228225 } ) ;
229226 if ( toolResult . userMessage ) {
@@ -285,8 +282,6 @@ class Agent {
285282
286283 try {
287284 let systemPrompt = await this . systemPrompt . toPromptText ( ) ;
288-
289- //TODO: append remix prompt from user
290285 const aiMessages : Message [ ] = [
291286 { role : "system" , content : systemPrompt } ,
292287 ...apiConversationHistory ,
@@ -313,14 +308,13 @@ class Agent {
313308 * @param toolInput - The input parameters for the tool
314309 * @returns Promise with tuple [userRejected, result]
315310 */
316- private async executeTool ( toolName : string , toolInput : any ) : Promise < [ boolean , any ] > {
311+ private async executeTool ( toolName : string , toolInput : any ) : Promise < any > {
317312 //codebolttools--readfile
318- console . log ( "Executing tool: " , toolName , toolInput ) ;
319313 const [ toolboxName , actualToolName ] = toolName . split ( '--' ) ;
320314 console . log ( "Toolbox name: " , toolboxName , "Actual tool name: " , actualToolName ) ;
321315 const { data} = await tools . executeTool ( toolboxName , actualToolName , toolInput ) ;
322316 console . log ( "Tool result: " , data ) ;
323- return [ false , data ] ;
317+ return data ;
324318 }
325319
326320 /**
@@ -360,7 +354,6 @@ class Agent {
360354 try {
361355 let parsed = JSON . parse ( content ) ;
362356
363- console . log ( "Parsed Content: " , parsed ) ;
364357 if ( parsed . payload && parsed . payload . content ) {
365358 content = `The browser action has been executed. The screenshot have been captured for your analysis. The tool response is provided in the next user message`
366359 // this.apiConversationHistory.push()
@@ -372,7 +365,7 @@ class Agent {
372365 return {
373366 role : "tool" ,
374367 tool_call_id,
375- content : content === "" ? "tool call success" : ( Array . isArray ( content ) ? content [ 1 ] : content ) ,
368+ content,
376369 userMessage
377370 } ;
378371 }
0 commit comments