@@ -2708,7 +2708,6 @@ export class Cline {
27082708 let normalizedSuggest = null
27092709
27102710 if ( values ) {
2711- console . log ( "values" , values )
27122711 type Suggest = {
27132712 suggest : string
27142713 }
@@ -2721,7 +2720,6 @@ export class Cline {
27212720 parsedSuggest = parseXml ( values , [ "values.suggest" ] ) as {
27222721 suggest : Suggest [ ] | Suggest
27232722 }
2724- console . log ( "parsedSuggest" , parsedSuggest )
27252723 } catch ( error ) {
27262724 this . consecutiveMistakeCount ++
27272725 await this . say ( "error" , `Failed to parse operations: ${ error . message } ` )
@@ -2734,8 +2732,6 @@ export class Cline {
27342732 normalizedSuggest = Array . isArray ( parsedSuggest ?. suggest )
27352733 ? parsedSuggest . suggest
27362734 : [ parsedSuggest ?. suggest ] . filter ( ( sug ) : sug is Suggest => sug !== undefined )
2737-
2738- console . log ( "normalizedSuggest" , normalizedSuggest )
27392735 } else {
27402736 this . consecutiveMistakeCount = 0
27412737 }
@@ -2765,45 +2761,39 @@ export class Cline {
27652761 }
27662762
27672763 const toolResults : ( Anthropic . TextBlockParam | Anthropic . ImageBlockParam ) [ ] = [ ]
2764+
27682765 if ( normalizedSuggest ) {
27692766 console . log ( "normalizedSuggest" , normalizedSuggest )
2770- const { text, images } = await this . ask (
2771- "prompt_suggest" ,
2772- JSON . stringify ( normalizedSuggest ) ,
2773- false ,
2774- )
2775- await this . say ( "user_feedback" , text ?? "" , images )
2776- pushToolResult (
2777- formatResponse . toolResult ( `<user_feedback>\n${ text } \n</user_feedback>` , images ) ,
2778- )
2779- } else {
2780- // we already sent completion_result says, an empty string asks relinquishes control over button and field
2781- const { response, text, images } = await this . ask ( "completion_result" , "" , false )
2782- if ( response === "yesButtonClicked" ) {
2783- pushToolResult ( "" ) // signals to recursive loop to stop (for now this never happens since yesButtonClicked will trigger a new task)
2784- break
2785- }
2786- await this . say ( "user_feedback" , text ?? "" , images )
2767+ await this . say ( "prompt_suggest" , JSON . stringify ( normalizedSuggest ) )
2768+ }
27872769
2788- if ( commandResult ) {
2789- if ( typeof commandResult === "string" ) {
2790- toolResults . push ( { type : "text" , text : commandResult } )
2791- } else if ( Array . isArray ( commandResult ) ) {
2792- toolResults . push ( ...commandResult )
2793- }
2770+ // we already sent completion_result says, an empty string asks relinquishes control over button and field
2771+ const { response, text, images } = await this . ask ( "completion_result" , "" , false )
2772+ if ( response === "yesButtonClicked" ) {
2773+ pushToolResult ( "" ) // signals to recursive loop to stop (for now this never happens since yesButtonClicked will trigger a new task)
2774+ break
2775+ }
2776+ await this . say ( "user_feedback" , text ?? "" , images )
2777+
2778+ if ( commandResult ) {
2779+ if ( typeof commandResult === "string" ) {
2780+ toolResults . push ( { type : "text" , text : commandResult } )
2781+ } else if ( Array . isArray ( commandResult ) ) {
2782+ toolResults . push ( ...commandResult )
27942783 }
2795- toolResults . push ( {
2796- type : "text" ,
2797- text : `The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\n${ text } \n</feedback>` ,
2798- } )
2799- toolResults . push ( ...formatResponse . imageBlocks ( images ) )
2800- this . userMessageContent . push ( {
2801- type : "text" ,
2802- text : `${ toolDescription ( ) } Result:` ,
2803- } )
2804- this . userMessageContent . push ( ...toolResults )
28052784 }
28062785
2786+ toolResults . push ( {
2787+ type : "text" ,
2788+ text : `The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\n${ text } \n</feedback>` ,
2789+ } )
2790+ toolResults . push ( ...formatResponse . imageBlocks ( images ) )
2791+ this . userMessageContent . push ( {
2792+ type : "text" ,
2793+ text : `${ toolDescription ( ) } Result:` ,
2794+ } )
2795+ this . userMessageContent . push ( ...toolResults )
2796+
28072797 break
28082798 }
28092799 } catch ( error ) {
0 commit comments