@@ -941,14 +941,18 @@ export class AgenticChatController implements ChatHandlers {
941941 toolUse : ToolUse ,
942942 resultStream : AgenticChatResultStream ,
943943 promptBlockId : number ,
944- session : ChatSessionService
944+ session : ChatSessionService ,
945+ toolName : string
945946 ) {
946947 const deferred = this . #createDeferred( )
947948 session . setDeferredToolExecution ( toolUse . toolUseId ! , deferred . resolve , deferred . reject )
948- this . #log( `Prompting for tool approval for tool: ${ toolUse . name } ` )
949+ this . #log( `Prompting for tool approval for tool: ${ toolName ?? toolUse . name } ` )
949950 await deferred . promise
950951 // Note: we want to overwrite the button block because it already exists in the stream.
951- await resultStream . overwriteResultBlock ( this . #getUpdateToolConfirmResult( toolUse , true ) , promptBlockId )
952+ await resultStream . overwriteResultBlock (
953+ this . #getUpdateToolConfirmResult( toolUse , true , toolName ) ,
954+ promptBlockId
955+ )
952956 }
953957
954958 /**
@@ -1054,7 +1058,13 @@ export class AgenticChatController implements ChatHandlers {
10541058 )
10551059 }
10561060 if ( requiresAcceptance ) {
1057- await this . waitForToolApproval ( toolUse , chatResultStream , cachedButtonBlockId , session )
1061+ await this . waitForToolApproval (
1062+ toolUse ,
1063+ chatResultStream ,
1064+ cachedButtonBlockId ,
1065+ session ,
1066+ toolUse . name
1067+ )
10581068 }
10591069 if ( isExecuteBash ) {
10601070 this . #telemetryController. emitInteractWithAgenticChat (
@@ -1098,7 +1108,8 @@ export class AgenticChatController implements ChatHandlers {
10981108 toolUse ,
10991109 chatResultStream ,
11001110 cachedButtonBlockId ,
1101- session
1111+ session ,
1112+ toolName
11021113 )
11031114 }
11041115
@@ -1230,7 +1241,7 @@ export class AgenticChatController implements ChatHandlers {
12301241 // Handle ToolApprovalException for any tool
12311242 if ( err instanceof ToolApprovalException && cachedButtonBlockId ) {
12321243 await chatResultStream . overwriteResultBlock (
1233- this . #getUpdateToolConfirmResult( toolUse , false ) ,
1244+ this . #getUpdateToolConfirmResult( toolUse , false , toolUse . name ) ,
12341245 cachedButtonBlockId
12351246 )
12361247 if ( err . shouldShowMessage ) {
@@ -1525,8 +1536,13 @@ export class AgenticChatController implements ChatHandlers {
15251536 * @param toolType Optional tool type for specialized handling
15261537 * @returns ChatResult with appropriate confirmation UI
15271538 */
1528- #getUpdateToolConfirmResult( toolUse : ToolUse , isAccept : boolean , toolType ?: string ) : ChatResult {
1529- const toolName = toolType || toolUse . name
1539+ #getUpdateToolConfirmResult(
1540+ toolUse : ToolUse ,
1541+ isAccept : boolean ,
1542+ originalToolName : string ,
1543+ toolType ?: string
1544+ ) : ChatResult {
1545+ const toolName = originalToolName ?? ( toolType || toolUse . name )
15301546
15311547 // Handle bash commands with special formatting
15321548 if ( toolName === 'executeBash' ) {
@@ -1585,15 +1601,15 @@ export class AgenticChatController implements ChatHandlers {
15851601 break
15861602
15871603 default :
1588- // Default tool (not MCP)
1604+ // Default tool (not only MCP)
15891605 return {
15901606 type : 'tool' ,
15911607 messageId : toolUse . toolUseId ! ,
15921608 summary : {
15931609 content : {
15941610 header : {
15951611 icon : 'tools' ,
1596- body : `${ toolUse . name } ` ,
1612+ body : `${ toolName } ` ,
15971613 status : {
15981614 status : isAccept ? 'success' : 'error' ,
15991615 icon : isAccept ? 'ok' : 'cancel' ,
0 commit comments