revert disposable handling of newly created tools. (#302646)

fix broken terminals in uncollapsed thinking modes
This commit is contained in:
Justin Chen
2026-03-17 21:06:29 -07:00
committed by GitHub
parent 070688f6e6
commit 12373f48a1

View File

@@ -1969,10 +1969,10 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
// Factory that creates the tool invocation part with all necessary setup
let lazilyCreatedPart: ChatToolInvocationPart | undefined = undefined;
const createToolPart = (): { domNode: HTMLElement; disposable: ChatToolInvocationPart; part: ChatToolInvocationPart } => {
const createToolPart = (): { domNode: HTMLElement; part: ChatToolInvocationPart } => {
lazilyCreatedPart = this.instantiationService.createInstance(ChatToolInvocationPart, toolInvocation, context, this.chatContentMarkdownRenderer, this._contentReferencesListPool, this._toolEditorPool, () => this._currentLayoutWidth.get(), this._toolInvocationCodeBlockCollection, this._announcedToolProgressKeys, codeBlockStartIndex);
this.handleRenderedCodeblocks(context.element, lazilyCreatedPart, codeBlockStartIndex);
return { domNode: lazilyCreatedPart.domNode, disposable: lazilyCreatedPart, part: lazilyCreatedPart };
return { domNode: lazilyCreatedPart.domNode, part: lazilyCreatedPart };
};
// handling for when we want to put tool invocations inside a thinking part
@@ -2028,7 +2028,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized,
thinkingPart: ChatThinkingContentPart,
getCreatedPart: () => ChatToolInvocationPart | undefined,
createToolPart: () => { domNode: HTMLElement; disposable: ChatToolInvocationPart; part: ChatToolInvocationPart },
createToolPart: () => { domNode: HTMLElement; part: ChatToolInvocationPart },
context: IChatContentPartRenderContext,
templateData: IChatListItemTemplate
): void {