From d6b3bdee3559e1ca106d9033679a57caa0e07068 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Sat, 12 Apr 2025 14:06:03 -0700 Subject: [PATCH] interrupt fallback --- .../workbench/contrib/void/browser/chatThreadService.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index b60563b0..ac4608c6 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -616,12 +616,13 @@ class ChatThreadService extends Disposable implements IChatThreadService { delete this._currentlyRunningToolInterruptor[threadId]; } toolResult = await result // ts is bad... await is needed + + if (interrupted) { return { interrupted: true } } // the tool result is added where we interrupt, not here } catch (error) { - if (interrupted) { - // the tool result is added when we stop running - return { interrupted: true } - } + if (interrupted) { return { interrupted: true } } // the tool result is added where we interrupt, not here + + const errorMessage = getErrorMessage(error) this._updateLatestTool(threadId, { role: 'tool', type: 'tool_error', params: toolParams, result: errorMessage, name: toolName, content: errorMessage, }) return {}