@@ -29,8 +29,9 @@ export class ChatToolInvocation implements IChatToolInvocation {
2929 return this . _confirmDeferred ;
3030 }
3131
32+ private _isConfirmed : ConfirmedReason | undefined ;
3233 public get isConfirmed ( ) : ConfirmedReason | undefined {
33- return this . _confirmDeferred . value ;
34+ return this . _isConfirmed ;
3435 }
3536
3637 private _resultDetails : IToolResult [ 'toolResultDetails' ] | undefined ;
@@ -64,10 +65,12 @@ export class ChatToolInvocation implements IChatToolInvocation {
6465
6566 if ( ! this . _confirmationMessages ) {
6667 // No confirmation needed
67- this . _confirmDeferred . complete ( { type : ToolConfirmKind . ConfirmationNotNeeded } ) ;
68+ this . _isConfirmed = { type : ToolConfirmKind . ConfirmationNotNeeded } ;
69+ this . _confirmDeferred . complete ( this . _isConfirmed ) ;
6870 }
6971
7072 this . _confirmDeferred . p . then ( confirmed => {
73+ this . _isConfirmed = confirmed ;
7174 this . _confirmationMessages = undefined ;
7275 } ) ;
7376
@@ -104,7 +107,7 @@ export class ChatToolInvocation implements IChatToolInvocation {
104107 invocationMessage : this . invocationMessage ,
105108 pastTenseMessage : this . pastTenseMessage ,
106109 originMessage : this . originMessage ,
107- isConfirmed : this . _confirmDeferred . value ,
110+ isConfirmed : this . _isConfirmed ,
108111 isComplete : true ,
109112 source : this . source ,
110113 resultDetails : isToolResultOutputDetails ( this . _resultDetails )
0 commit comments