Skip to content

Commit b2fb4ac

Browse files
authored
Revert "fix: confirm response based on promise (microsoft#263894)" (microsoft#264047)
This reverts commit 6f24cee. It broke tool calling: microsoft#264023. I also need to re-asses how I missed this during testing.
1 parent 6905765 commit b2fb4ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)