@@ -169,14 +169,17 @@ export default class LangChainManager extends AIManager {
169169 const assistantPrompt : Prompt = {
170170 role : 'assistant' ,
171171 content : fullContent ,
172- toolCalls : toolCalls . length > 0 ? toolCalls . map ( tc => ( {
173- type : 'function' ,
174- id : tc . id ,
175- function : {
176- name : tc . name ,
177- arguments : JSON . stringify ( tc . args || { } ) ,
178- } ,
179- } ) ) : undefined ,
172+ toolCalls :
173+ toolCalls . length > 0
174+ ? toolCalls . map ( tc => ( {
175+ type : 'function' ,
176+ id : tc . id ,
177+ function : {
178+ name : tc . name ,
179+ arguments : JSON . stringify ( tc . args || { } ) ,
180+ } ,
181+ } ) )
182+ : undefined ,
180183 } ;
181184
182185 // If there are tool calls, handle them with streaming
@@ -209,7 +212,7 @@ export default class LangChainManager extends AIManager {
209212 }
210213
211214 // Clear progress steps for non-tool responses
212- }
215+ }
213216
214217 return assistantPrompt ;
215218 } catch ( error ) {
@@ -864,7 +867,7 @@ The user is waiting for you to explain what the tools discovered. Provide a dire
864867 this . history . push ( assistantPrompt ) ;
865868
866869 // Clear progress steps for non-tool responses
867-
870+
868871 return assistantPrompt ;
869872 }
870873 } catch ( error ) {
@@ -1103,12 +1106,10 @@ The user is waiting for you to explain what the tools discovered. Provide a dire
11031106 } )
11041107 ) ;
11051108
1106- let approvedToolIds : string [ ] = [ ] ;
1109+ const approvedToolIds : string [ ] = [ ] ;
11071110
11081111 // Separate built-in tools from MCP tools (same pattern as handleToolCalls)
1109- const builtInToolsForApproval = toolsForApproval . filter ( tool =>
1110- isBuiltInTool ( tool . name )
1111- ) ;
1112+ const builtInToolsForApproval = toolsForApproval . filter ( tool => isBuiltInTool ( tool . name ) ) ;
11121113 const mcpToolsForApproval = toolsForApproval . filter ( tool => ! isBuiltInTool ( tool . name ) ) ;
11131114
11141115 // Auto-approve all built-in tools (no user interaction needed)
@@ -1141,9 +1142,7 @@ The user is waiting for you to explain what the tools discovered. Provide a dire
11411142 // Match by checking if the approved ID contains the tool name as a suffix
11421143 const approvedTools = recommendedTools . filter ( tool => {
11431144 const expectedIdPrefix = `orchestrated-${ tool . name } -` ;
1144- return approvedToolIds . some (
1145- id => id === tool . name || id . startsWith ( expectedIdPrefix )
1146- ) ;
1145+ return approvedToolIds . some ( id => id === tool . name || id . startsWith ( expectedIdPrefix ) ) ;
11471146 } ) ;
11481147
11491148 // Group tools by execution strategy (parallel vs sequential)
@@ -1411,7 +1410,7 @@ ${Object.entries(toolResults)
14111410 this . history . push ( assistantPrompt ) ;
14121411
14131412 // Clear progress steps when all tools are disabled
1414-
1413+
14151414 return assistantPrompt ;
14161415 }
14171416
@@ -1464,12 +1463,12 @@ Without access to the Kubernetes API, I cannot fetch current pod, deployment, se
14641463 this . history [ this . history . length - 1 ] = updatedPrompt ;
14651464
14661465 // Clear progress steps when tools are disabled
1467-
1466+
14681467 return updatedPrompt ;
14691468 }
14701469
14711470 // Clear progress steps when no tools to execute
1472-
1471+
14731472 return assistantPrompt ;
14741473 }
14751474
@@ -1625,7 +1624,10 @@ Without access to the Kubernetes API, I cannot fetch current pod, deployment, se
16251624 * Handle tool calls for streaming scenario - executes tools without generating response
16261625 * (response will be streamed separately by processToolResponsesStream)
16271626 */
1628- private async handleToolCallsForStreaming ( toolCalls : any [ ] , assistantPrompt : Prompt ) : Promise < void > {
1627+ private async handleToolCallsForStreaming (
1628+ toolCalls : any [ ] ,
1629+ assistantPrompt : Prompt
1630+ ) : Promise < void > {
16291631 const enabledToolIds = this . toolManager . getToolNames ( ) ;
16301632
16311633 // Convert tool calls to expected format
@@ -1699,10 +1701,7 @@ Without access to the Kubernetes API, I cannot fetch current pod, deployment, se
16991701
17001702 // Request approval for MCP tools
17011703 if ( mcpTools . length > 0 ) {
1702- const approvedMCPToolIds = await inlineToolApprovalManager . requestApproval (
1703- mcpTools ,
1704- this
1705- ) ;
1704+ const approvedMCPToolIds = await inlineToolApprovalManager . requestApproval ( mcpTools , this ) ;
17061705 approvedToolIds . push ( ...approvedMCPToolIds ) ;
17071706 }
17081707
@@ -2097,14 +2096,14 @@ Format your response to make the errors prominent and actionable.`,
20972096 this . history . push ( assistantPrompt ) ;
20982097
20992098 // Clear progress steps after streaming response
2100-
2099+
21012100 return assistantPrompt ;
21022101 } catch ( error ) {
21032102 const errorPrompt = this . handleToolResponseError ( error ) ;
21042103 yield errorPrompt . content ;
21052104
21062105 // Clear progress steps even on error
2107-
2106+
21082107 return errorPrompt ;
21092108 }
21102109 }
@@ -2790,7 +2789,9 @@ Return the complete arguments object:`;
27902789 key . toLowerCase ( ) . includes ( 'max' ) )
27912790 ) {
27922791 sanitized [ key ] = parseFloat ( value ) ;
2793- console . log ( `[ArgSanitize] Converted ${ key } from string "${ value } " to number ${ sanitized [ key ] } ` ) ;
2792+ console . log (
2793+ `[ArgSanitize] Converted ${ key } from string "${ value } " to number ${ sanitized [ key ] } `
2794+ ) ;
27942795 continue ;
27952796 }
27962797 }
0 commit comments