Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,10 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
}

if (part.kind === 'toolInvocation') {
// pin when streaming since we don't know if we have confirmation yet or not
if (IChatToolInvocation.isStreaming(part)) {
return true;
}
return !IChatToolInvocation.getConfirmationMessages(part);
}

Expand Down Expand Up @@ -1693,6 +1697,27 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
if (lastThinking && part?.domNode && toolInvocation.presentation !== 'hidden') {
lastThinking.appendItem(part?.domNode, toolInvocation.toolId, toolInvocation, templateData.value);
lastThinking.addDisposable(part);

// watch for streaming -> confirmation transition to finalize thinking
if (toolInvocation.kind === 'toolInvocation' && IChatToolInvocation.isStreaming(toolInvocation)) {
let wasStreaming = true;
part.addDisposable(autorun(reader => {
const state = toolInvocation.state.read(reader);
if (wasStreaming && state.type !== IChatToolInvocation.StateKind.Streaming) {
wasStreaming = false;
if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
if (part.domNode) {
const wrapper = part.domNode.parentElement;
if (wrapper?.classList.contains('chat-thinking-tool-wrapper')) {
wrapper.remove();
}
templateData.value.appendChild(part.domNode);
}
this.finalizeCurrentThinkingPart(context, templateData);
}
}
}));
Comment thread
justschen marked this conversation as resolved.
}
}
} else {
this.finalizeCurrentThinkingPart(context, templateData);
Expand Down
Loading