@@ -1591,21 +1591,17 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
15911591 }
15921592
15931593 const autoApproveOrReject = async ( ) => {
1594- // Check for auto-reject first (commands that should be denied)
1594+ // Check for auto-reject first (commands that should be denied).
15951595 if ( lastMessage ?. ask === "command" && isDeniedCommand ( lastMessage ) ) {
1596- // Get the denied prefix for the localized message
1596+ // Get the denied prefix for the localized message.
15971597 const deniedPrefix = getDeniedPrefix ( lastMessage . text || "" )
1598+
15981599 if ( deniedPrefix ) {
1599- // Create the localized auto-deny message and send it with the rejection
1600+ // Create the localized auto-deny message and send it with the rejection.
16001601 const autoDenyMessage = tSettings ( "autoApprove.execute.autoDenied" , { prefix : deniedPrefix } )
1601-
1602- vscode . postMessage ( {
1603- type : "askResponse" ,
1604- askResponse : "noButtonClicked" ,
1605- text : autoDenyMessage ,
1606- } )
1602+ vscode . postMessage ( { type : "askResponse" , askResponse : "noButtonClicked" , text : autoDenyMessage } )
16071603 } else {
1608- // Auto-reject denied commands immediately if no prefix found
1604+ // Auto-reject denied commands immediately if no prefix found.
16091605 vscode . postMessage ( { type : "askResponse" , askResponse : "noButtonClicked" } )
16101606 }
16111607
@@ -1668,39 +1664,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
16681664 setClineAsk ( undefined )
16691665 setEnableButtons ( false )
16701666 } else if ( lastMessage ?. ask ) {
1671- // Ask requires user interaction - not auto-approved or auto-rejected.
1672- const reason = ( ( ) => {
1673- if ( autoApprovalEnabled !== true ) {
1674- return "auto_approval_disabled"
1675- }
1676-
1677- // Determine more specific reasons based on the ask type.
1678- switch ( lastMessage . ask ) {
1679- case "command" :
1680- return "command_requires_manual_approval"
1681- case "tool" :
1682- return "tool_requires_manual_approval"
1683- case "browser_action_launch" :
1684- return "browser_action_requires_manual_approval"
1685- case "use_mcp_server" :
1686- return "mcp_requires_manual_approval"
1687- case "followup" :
1688- return "followup_requires_manual_response"
1689- case "completion_result" :
1690- return "completion_requires_manual_confirmation"
1691- case "api_req_failed" :
1692- return "api_failure_requires_manual_decision"
1693- case "mistake_limit_reached" :
1694- return "mistake_limit_requires_manual_guidance"
1695- case "auto_approval_max_req_reached" :
1696- return "approval_limit_reached"
1697- default :
1698- return "manual_approval_required"
1699- }
1700- } ) ( )
1701-
17021667 // Notify the extension host that this ask requires user interaction.
1703- vscode . postMessage ( { type : "askRequiresInteraction" , askType : lastMessage . ask , reason : reason } )
1668+ vscode . postMessage ( { type : "askRequiresInteraction" , askType : lastMessage . ask } )
17041669 }
17051670 }
17061671
0 commit comments