From a8cc68b14928f61520cec5aa5c91eaa2bba85505 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:18:40 +0000 Subject: [PATCH] Fix this-binding: use arrow functions in LLMMessageServiceWeb RefreshModelService extracts methods as standalone functions (e.g. const listFn = this.llmMessageService.openAICompatibleList) which loses the this context. Converting to arrow function properties ensures this is always bound to the class instance. Co-Authored-By: Danial Piterson --- .../contrib/void/common/sendLLMMessageService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/void/common/sendLLMMessageService.ts b/src/vs/workbench/contrib/void/common/sendLLMMessageService.ts index 8004df64..fd13cac2 100644 --- a/src/vs/workbench/contrib/void/common/sendLLMMessageService.ts +++ b/src/vs/workbench/contrib/void/common/sendLLMMessageService.ts @@ -216,7 +216,7 @@ if (!isWeb) { @IVoidSettingsService private readonly voidSettingsService: IVoidSettingsService, ) { super(); } - sendLLMMessage(params: ServiceSendLLMMessageParams): string | null { + sendLLMMessage = (params: ServiceSendLLMMessageParams): string | null => { const { onText, onFinalMessage, onError, modelSelection } = params; if (modelSelection === null) { onError({ message: `Please add a provider in Void's Settings.`, fullError: null }); @@ -296,16 +296,16 @@ if (!isWeb) { return requestId; } - abort(requestId: string) { + abort = (requestId: string) => { this._abortControllers.get(requestId)?.abort(); this._abortControllers.delete(requestId); } - ollamaList(params: ServiceModelListParams) { + ollamaList = (params: ServiceModelListParams) => { params.onError({ error: 'Ollama not available in web mode' }); } - openAICompatibleList(params: ServiceModelListParams) { + openAICompatibleList = (params: ServiceModelListParams) => { const { settingsOfProvider } = this.voidSettingsService.state; const providerSettings = settingsOfProvider[params.providerName]; const apiKey = (providerSettings as any).apiKey as string | undefined;