From da9817bd9946211d8b32ff4b680cc301a73ae416 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Sun, 20 Apr 2025 18:44:07 -0700 Subject: [PATCH] misc --- .../contrib/void/browser/chatThreadService.ts | 20 ++++++++++--------- .../react/src/void-settings-tsx/Settings.tsx | 6 ++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index 0a033524..7a09327d 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -542,6 +542,7 @@ class ChatThreadService extends Disposable implements IChatThreadService { if (interrupted) { return { interrupted: true } } // the tool result is added where we interrupt, not here } catch (error) { + delete this._currentlyRunningToolInterruptor[threadId] if (interrupted) { return { interrupted: true } } // the tool result is added where we interrupt, not here @@ -561,6 +562,7 @@ class ChatThreadService extends Disposable implements IChatThreadService { // 5. add to history and keep going this._updateLatestTool(threadId, { role: 'tool', type: 'success', params: toolParams, result: toolResult, name: toolName, content: toolResultStr, id: toolId, rawParams: opts.unvalidatedToolParams }) + delete this._currentlyRunningToolInterruptor[threadId] return {} }; @@ -1043,8 +1045,8 @@ We only need to do it for files that were edited since `from`, ie files between if (!thread) return // should never happen const llmCancelToken = this.streamState[threadId]?.streamingToken // currently streaming LLM on this thread - if (llmCancelToken === undefined && this.streamState[threadId]?.isRunning === 'LLM') { - // if about to call the other LLM, just wait for it by stopping right now + if (llmCancelToken === undefined && this.streamState[threadId]?.isRunning) { + // if about to call the other LLM, just wait for and stop now return } // stop it (this simply resolves the promise to free up space) @@ -1421,13 +1423,13 @@ We only need to do it for files that were edited since `from`, ie files between openNewThread() { // if a thread with 0 messages already exists, switch to it const { allThreads: currentThreads } = this.state - for (const threadId in currentThreads) { - if (currentThreads[threadId]!.messages.length === 0) { - // switch to the existing empty thread and exit - this.switchToThread(threadId) - return - } - } + for (const threadId in currentThreads) { + if (currentThreads[threadId]!.messages.length === 0) { + // switch to the existing empty thread and exit + this.switchToThread(threadId) + return + } + } // otherwise, start a new thread const newThread = newThreadObject() diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 887214a9..6cbefb7f 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -869,11 +869,13 @@ export const Settings = () => { let dataStr: string let downloadName: string if (t === 'Chats') { - dataStr = JSON.stringify(voidSettingsService.state, null, 2) + // Export chat threads + dataStr = JSON.stringify(chatThreadsService.state, null, 2) downloadName = 'void-chats.json' } else if (t === 'Settings') { - dataStr = JSON.stringify(chatThreadsService.state, null, 2) + // Export user settings + dataStr = JSON.stringify(voidSettingsService.state, null, 2) downloadName = 'void-settings.json' } else {