diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index d8dcff01..ad6ad508 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -108,7 +108,7 @@ export type ThreadsState = { export type ThreadStreamState = { [threadId: string]: undefined | { // state related - isRunning?: undefined | true; // whether or not actually running the agent loop (can be running and not streaming, like if it's calling a tool and awaiting user response) + isRunning?: undefined | 'message' | 'tool'; // whether or not actually running the agent loop (can be running and not streaming, like if it's calling a tool and awaiting user response) error?: { message: string, fullError: Error | null, }; // streaming related @@ -722,6 +722,7 @@ class ChatThreadService extends Disposable implements IChatThreadService { } // 3. call the tool + this._setStreamState(threadId, { isRunning: 'tool' }, 'merge') try { toolResult = await this._toolsService.callTool[toolName](toolParams as any) // ts is bad... } catch (error) { @@ -748,8 +749,8 @@ class ChatThreadService extends Disposable implements IChatThreadService { const { chatMode } = this._settingsService.state.globalSettings // should not change as we loop even if user changes it, so it goes here const tools = this._tools(chatMode) - // clear any previous error + set running - this._setStreamState(threadId, { isRunning: true, error: undefined }, 'set') + // clear any previous error + this._setStreamState(threadId, { error: undefined }, 'set') let nMessagesSent = 0 let shouldSendAnotherMessage = true @@ -757,11 +758,13 @@ class ChatThreadService extends Disposable implements IChatThreadService { // before enter loop, call tool if (callThisToolFirst) { + this._setStreamState(threadId, { isRunning: 'tool' }, 'merge') await handleToolCall(callThisToolFirst, { preapproved: true, toolParams: callThisToolFirst.params }) } // tool use loop while (shouldSendAnotherMessage) { + this._setStreamState(threadId, { isRunning: 'message' }, 'merge') // false by default each iteration shouldSendAnotherMessage = false diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index 26ecd031..1a36033e 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -1912,8 +1912,7 @@ export const SidebarChat = () => { // stream state const currThreadStreamState = useChatThreadsStreamState(chatThreadsState.currentThreadId) - const isRunning = !!currThreadStreamState?.isRunning - const isStreaming = !!currThreadStreamState?.streamingToken // might be running but not streaming + const isRunning = currThreadStreamState?.isRunning const latestError = currThreadStreamState?.error const messageSoFar = currThreadStreamState?.messageSoFar const reasoningSoFar = currThreadStreamState?.reasoningSoFar @@ -1978,7 +1977,7 @@ export const SidebarChat = () => { const previousMessagesHTML = useMemo(() => { return previousMessages.map((message, i) => { - const isLast = i === numMessages - 1 && !isStreaming // last if there is no streaming assistant message currently + const isLast = i === numMessages - 1 && isRunning !== 'tool' return { /> } ) - }, [previousMessages, isStreaming, currentThread, numMessages]) + }, [previousMessages, isRunning, currentThread, numMessages]) const streamingChatIdx = previousMessagesHTML.length - const currStreamingMessageHTML = !!(reasoningSoFar || messageSoFar || isRunning || isStreaming) ? + const currStreamingMessageHTML = !!(reasoningSoFar || messageSoFar || isRunning) ? { divRef={chatAreaRef} onSubmit={onSubmit} onAbort={onAbort} - isStreaming={isRunning} + isStreaming={!!isRunning} isDisabled={isDisabled} showSelections={true} showProspectiveSelections={previousMessagesHTML.length === 0} diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx index 65b571e4..2e0b4bd2 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarThreadSelector.tsx @@ -106,7 +106,7 @@ export const SidebarThreadSelector = () => { `} onClick={() => chatThreadsService.switchToThread(pastThread.id)} onDoubleClick={() => sidebarStateService.setState({ isHistoryOpen: false })} - title={new Date(pastThread.createdAt).toLocaleString()} + title={new Date(pastThread.lastModified).toLocaleString()} >
{`${firstMsg}`}
{`\u00A0(${numMessages})`}
diff --git a/src/vs/workbench/contrib/void/common/prompt/prompts.ts b/src/vs/workbench/contrib/void/common/prompt/prompts.ts index c5918131..d734be2f 100644 --- a/src/vs/workbench/contrib/void/common/prompt/prompts.ts +++ b/src/vs/workbench/contrib/void/common/prompt/prompts.ts @@ -19,7 +19,7 @@ export const editToolDesc_toolDescription = `\ A high level description of the change you'd like to make in the file. This description will be handed to a dumber, faster model that will quickly apply the change.\ The model does not have ANY context except the file content and this description, so make sure to include all necessary information to make the change here.\ Typically the best description you can give is a code block of the form:\n${tripleTick[0]}\n// ... existing code ...\n{{change 1}}\n// ... existing code ...\n{{change2}}\n// ... existing code ...\n{{change 3}}\n...\n${tripleTick[1]}. \ -Do NOT output the whole file here if possible, and try to write as LITTLE code as needed to describe the change.` +Wrap your output in triple ticks. Do NOT output the whole file here if possible, and try to write as LITTLE code as needed to describe the change.`