Don't clear chat disposables too early while progressive rendering (#215907)

This clear() is wrong because this loop is incrementally updating content, not rerendering everything. Deleting is also not quite right because we are technically leaking when things get rerendered. But that is only the case while in the middle of streaming content, and things will always be fixed up when the response is done loading.
Fix #212853
This commit is contained in:
Rob Lourens 2024-06-16 20:47:44 -07:00 committed by GitHub
parent b49212f5cb
commit 85e9b0786c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -684,7 +684,6 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
disposables.clear();
this.basicRenderElement(renderableResponse, element, index, templateData);
} else if (!isFullyRendered) {
disposables.clear();
this.renderContentReferencesIfNeeded(element, templateData, disposables);
let hasRenderedOneMarkdownBlock = false;
partsToRender.forEach((partToRender, index) => {