Skip to content

Commit 42e26aa

Browse files
authored
Handle command button part (#10979)
Address #10364 Shiny has responses that include command buttons and they aren't handled by Assistant when it tries to review the chat history. ### Release Notes #### New Features - N/A #### Bug Fixes - Fix error when chat history has a participant ### QA Notes
1 parent a3c249d commit 42e26aa

File tree

1 file changed

+2
-0
lines changed
  • extensions/positron-assistant/src

1 file changed

+2
-0
lines changed

extensions/positron-assistant/src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ export function toLanguageModelChatMessage(turns: vscode.ChatContext['history'])
335335
return acc + `\n\nSuggested text edits: ${JSON.stringify(content.edits)}\n\n`;
336336
} else if (content instanceof vscode.ChatResponseAnchorPart) {
337337
return acc + `\n\nAnchor: ${content.title ? `${content.title} ` : ''}${JSON.stringify(content.value2)}\n\n`;
338+
} else if (content instanceof vscode.ChatResponseCommandButtonPart) {
339+
return acc;
338340
} else {
339341
// TODO: Lower more history entry types to text.
340342
throw new Error(`Unsupported response kind when lowering chat agent response: ${content.constructor.name}`);

0 commit comments

Comments
 (0)