Get rid of chat progress Task (#202777)

This commit is contained in:
Rob Lourens
2024-01-18 23:26:36 +01:00
committed by GitHub
parent 834e74297f
commit 3c8e0fc16d
3 changed files with 3 additions and 37 deletions
@@ -98,20 +98,7 @@ export class ExtHostChatAgents2 implements ExtHostChatAgentsShape2 {
}
if ('placeholder' in progress && 'resolvedContent' in progress) {
const resolvedContent = Promise.all([this._proxy.$handleProgressChunk(request.requestId, convertedProgress), progress.resolvedContent]);
raceCancellation(resolvedContent, token).then(res => {
if (!res) {
return; /* Cancelled */
}
const [progressHandle, progressContent] = res;
const convertedContent = typeConvert.ChatResponseProgress.from(agent.extension, progressContent);
if (!convertedContent) {
this._logService.error('Unknown progress type: ' + JSON.stringify(progressContent));
return;
}
this._proxy.$handleProgressChunk(request.requestId, convertedContent, progressHandle ?? undefined);
});
// Ignore for now, this is the deleted Task type
} else {
this._proxy.$handleProgressChunk(request.requestId, convertedProgress);
}
@@ -2320,9 +2320,7 @@ export namespace InteractiveEditorResponseFeedbackKind {
export namespace ChatResponseProgress {
export function from(extension: IExtensionDescription, progress: vscode.ChatAgentExtendedProgress): extHostProtocol.IChatProgressDto | undefined {
if ('placeholder' in progress && 'resolvedContent' in progress) {
return { content: progress.placeholder, kind: 'asyncContent' } satisfies extHostProtocol.IChatAsyncContentDto;
} else if ('markdownContent' in progress) {
if ('markdownContent' in progress) {
checkProposedApiEnabled(extension, 'chatAgents2Additions');
return { content: MarkdownString.from(progress.markdownContent), kind: 'markdownContent' };
} else if ('content' in progress) {
+1 -20
View File
@@ -270,8 +270,7 @@ declare module 'vscode' {
export type ChatAgentContentProgress =
| ChatAgentContent
| ChatAgentFileTree
| ChatAgentInlineContentReference
| ChatAgentTask;
| ChatAgentInlineContentReference;
export type ChatAgentMetadataProgress =
| ChatAgentUsedContext
@@ -322,24 +321,6 @@ declare module 'vscode' {
content: string;
}
/**
* Represents a piece of the chat response's content that is resolved asynchronously. It is rendered immediately with a placeholder,
* which is replaced once the full content is available.
*/
export interface ChatAgentTask {
/**
* The markdown string to be rendered immediately.
*/
placeholder: string;
/**
* A Thenable resolving to the real content. The placeholder will be replaced with this content once it's available.
*/
// TODO@API Should this be an async iterable or progress instance instead
// TODO@API Should this include more inline-renderable items like `ChatAgentInlineContentReference`
resolvedContent: Thenable<ChatAgentContent | ChatAgentFileTree>;
}
/**
* Represents a tree, such as a file and directory structure, rendered in the chat response.
*/