@@ -1504,7 +1504,7 @@ export class Cline {
15041504 }
15051505
15061506 this . consecutiveMistakeCount = 0
1507- const didApprove = await askApproval ( "browser_action_launch" , url )
1507+ const didApprove = this . alwaysAllowBrowser || await askApproval ( "browser_action_launch" , url )
15081508 if ( ! didApprove ) {
15091509 break
15101510 }
@@ -1567,7 +1567,6 @@ export class Cline {
15671567 break
15681568 }
15691569 }
1570-
15711570 switch ( action ) {
15721571 case "launch" :
15731572 case "click" :
@@ -1595,7 +1594,7 @@ export class Cline {
15951594 break
15961595 }
15971596 } catch ( error ) {
1598- await this . browserSession . closeBrowser ( )
1597+ await this . browserSession . closeBrowser ( ) // if any error occurs, the browser session is terminated
15991598 await handleError ( "executing browser action" , error )
16001599 break
16011600 }
@@ -1763,11 +1762,7 @@ export class Cline {
17631762
17641763 const { response, text, images } = await this . ask ( "completion_result" , "" , false )
17651764 if ( response === "yesButtonClicked" ) {
1766- // Only close browser if not in interactive mode
1767- if ( ! this . browserSession . isInInteractiveMode ) {
1768- await this . browserSession . closeBrowser ( )
1769- }
1770- pushToolResult ( "" )
1765+ pushToolResult ( "" ) // signals to recursive loop to stop (for now this never happens since yesButtonClicked will trigger a new task)
17711766 break
17721767 }
17731768 await this . say ( "user_feedback" , text ?? "" , images )
@@ -1794,7 +1789,7 @@ export class Cline {
17941789 break
17951790 }
17961791 } catch ( error ) {
1797- await handleError ( "completing task " , error )
1792+ await handleError ( "inspecting site " , error )
17981793 break
17991794 }
18001795 }
0 commit comments