Skip to content

Commit abd11f0

Browse files
authored
Fix command buttons in 'push' (microsoft#208248)
Fix microsoft#207885
1 parent 9259289 commit abd11f0

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/vs/workbench/api/common/extHostChatAgents2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ChatAgentResponseStream {
122122
},
123123
push(part) {
124124
throwIfDone(this.push);
125-
const dto = typeConvert.ChatResponsePart.to(part);
125+
const dto = typeConvert.ChatResponsePart.to(part, that._commandsConverter, that._sessionDisposables);
126126
_report(dto);
127127
return this;
128128
},

src/vs/workbench/api/common/extHostChatVariables.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ class ChatVariableResolverResponseStream {
109109
},
110110
push(part) {
111111
throwIfDone(this.push);
112-
const dto = typeConvert.ChatResponsePart.to(part);
113-
_report(dto as IChatVariableResolverProgressDto);
112+
113+
if (part instanceof extHostTypes.ChatResponseReferencePart) {
114+
_report(typeConvert.ChatResponseReferencePart.to(part));
115+
} else if (part instanceof extHostTypes.ChatResponseProgressPart) {
116+
_report(typeConvert.ChatResponseProgressPart.to(part));
117+
}
118+
114119
return this;
115120
}
116121
};

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,7 @@ export namespace ChatResponseReferencePart {
24542454

24552455
export namespace ChatResponsePart {
24562456

2457-
export function to(part: vscode.ChatResponsePart): extHostProtocol.IChatProgressDto {
2457+
export function to(part: vscode.ChatResponsePart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto {
24582458
if (part instanceof types.ChatResponseMarkdownPart) {
24592459
return ChatResponseMarkdownPart.to(part);
24602460
} else if (part instanceof types.ChatResponseAnchorPart) {
@@ -2465,6 +2465,8 @@ export namespace ChatResponsePart {
24652465
return ChatResponseProgressPart.to(part);
24662466
} else if (part instanceof types.ChatResponseFileTreePart) {
24672467
return ChatResponseFilesPart.to(part);
2468+
} else if (part instanceof types.ChatResponseCommandButtonPart) {
2469+
return ChatResponseCommandButtonPart.to(part, commandsConverter, commandDisposables);
24682470
}
24692471
return {
24702472
kind: 'content',

0 commit comments

Comments
 (0)