From 857eda72fd8ec19d132a35dbde545b538e93d660 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 20:54:52 -0700 Subject: [PATCH 1/9] remove toolname prefix in sidebar and remove unused logic --- .../react/src/sidebar-tsx/SidebarChat.tsx | 3 +- .../contrib/void/common/mcpServiceTypes.ts | 6 +++ .../contrib/void/electron-main/mcpChannel.ts | 38 ++----------------- 3 files changed, 12 insertions(+), 35 deletions(-) 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 26b12cc8..9533958f 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 @@ -34,6 +34,7 @@ import ErrorBoundary from './ErrorBoundary.js'; import { ToolApprovalTypeSwitch } from '../void-settings-tsx/Settings.js'; import { persistentTerminalNameOfId } from '../../../terminalToolService.js'; +import { removeMCPToolNamePrefix } from '../../../../common/mcpServiceTypes.js'; @@ -1857,7 +1858,7 @@ const MCPToolWrapper = ({ toolMessage }: WrapperProps) => { const mcpService = accessor.get('IMCPService') const title = getTitle(toolMessage) - const desc1 = toolMessage.name + const desc1 = removeMCPToolNamePrefix(toolMessage.name) const icon = null diff --git a/src/vs/workbench/contrib/void/common/mcpServiceTypes.ts b/src/vs/workbench/contrib/void/common/mcpServiceTypes.ts index 170cb843..81fc716f 100644 --- a/src/vs/workbench/contrib/void/common/mcpServiceTypes.ts +++ b/src/vs/workbench/contrib/void/common/mcpServiceTypes.ts @@ -234,3 +234,9 @@ export interface MCPToolCallParams { toolName: string; params: Record; } + + + +export const removeMCPToolNamePrefix = (name: string) => { + return name.split('_').slice(1).join('_') +} diff --git a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts index 7e1be86b..3877117f 100644 --- a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts +++ b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts @@ -13,7 +13,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'; import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'; -import { MCPConfigFileJSON, MCPConfigFileEntryJSON, MCPServer, RawMCPToolCall, MCPToolErrorResponse, MCPServerEventResponse, MCPToolCallParams } from '../common/mcpServiceTypes.js'; +import { MCPConfigFileJSON, MCPConfigFileEntryJSON, MCPServer, RawMCPToolCall, MCPToolErrorResponse, MCPServerEventResponse, MCPToolCallParams, removeMCPToolNamePrefix } from '../common/mcpServiceTypes.js'; import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js'; import { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import { MCPUserStateOfName } from '../common/voidSettingsTypes.js'; @@ -310,7 +310,7 @@ export class MCPChannel implements IServerChannel { // Call the tool with the provided parameters const response = await client.callTool({ - name: toolName, + name: removeMCPToolNamePrefix(toolName), arguments: params }) const { content } = response as CallToolResult @@ -354,41 +354,11 @@ export class MCPChannel implements IServerChannel { const response = await this._callTool(serverName, toolName, params) return response } catch (err) { + let errorMessage: string; // Check if it's an MCP error with a code - if (err && typeof err === 'object' && 'code' in err) { - const errorCode = err.code; - const errorName = err.name || 'Unknown Error'; - const errorMsg = err.message || ''; - - // Map common JSON-RPC error codes to user-friendly messages - let codeDescription = ''; - switch (errorCode) { - case -32700: - codeDescription = 'Parse Error'; - break; - case -32600: - codeDescription = 'Invalid Request'; - break; - case -32601: - codeDescription = 'Method Not Found'; - break; - case -32602: - codeDescription = 'Invalid Parameters'; - break; - case -32603: - codeDescription = 'Internal Error'; - break; - default: - codeDescription = `Error Code ${errorCode}`; - } - - errorMessage = `${errorName} (${codeDescription})${errorMsg ? ': ' + errorMsg : ''}`; - } else if (err && typeof err === 'object' && 'message' in err) { - // Standard error with message - errorMessage = err.message; - } else if (typeof err === 'string') { + if (typeof err === 'string') { // String error errorMessage = err; } else { From 7feb9154dae79c1be7c73b9cd587b649e5c0b0c8 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 21:02:21 -0700 Subject: [PATCH 2/9] err codes --- .../contrib/void/electron-main/mcpChannel.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts index 3877117f..37607c8e 100644 --- a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts +++ b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts @@ -357,8 +357,23 @@ export class MCPChannel implements IServerChannel { let errorMessage: string; + if (typeof err === 'object' && err !== null && err['code']) { + const code = err.code + let codeDescription = '' + if (code === -32700) + codeDescription = 'Parse Error'; + if (code === -32600) + codeDescription = 'Invalid Request'; + if (code === -32601) + codeDescription = 'Method Not Found'; + if (code === -32602) + codeDescription = 'Invalid Parameters'; + if (code === -32603) + codeDescription = 'Internal Error'; + errorMessage = `${codeDescription}. Full response:\n${JSON.stringify(err, null, 2)}` + } // Check if it's an MCP error with a code - if (typeof err === 'string') { + else if (typeof err === 'string') { // String error errorMessage = err; } else { From 2b4283a0f09aa4333ff6e634e05db2915d79f03c Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 21:10:23 -0700 Subject: [PATCH 3/9] rm comments --- src/vs/workbench/contrib/void/common/mcpService.ts | 2 +- src/vs/workbench/contrib/void/electron-main/mcpChannel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/void/common/mcpService.ts b/src/vs/workbench/contrib/void/common/mcpService.ts index c40afb43..1b559571 100644 --- a/src/vs/workbench/contrib/void/common/mcpService.ts +++ b/src/vs/workbench/contrib/void/common/mcpService.ts @@ -88,7 +88,7 @@ class MCPService extends Disposable implements IMCPService { const onEvent = (e: MCPServerEventResponse) => { - console.log('GOT EVENT', e) + // console.log('GOT EVENT', e) this._setMCPServerState(e.response.name, e.response.newServer) } this._register((this.channel.listen('onAdd_server') satisfies Event)(onEvent)); diff --git a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts index 4db5a332..e5c4fb6e 100644 --- a/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts +++ b/src/vs/workbench/contrib/void/electron-main/mcpChannel.ts @@ -195,7 +195,7 @@ export class MCPChannel implements IServerChannel { } } } else if (server.command) { - console.log('ENV DATA: ', server.env) + // console.log('ENV DATA: ', server.env) transport = new StdioClientTransport({ command: server.command, args: server.args, From 8e6bb7194dbcff0d07ea9f97f544e701f9c4ed26 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 21:15:24 -0700 Subject: [PATCH 4/9] 1.4.0! --- product.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product.json b/product.json index 3ec55d64..1cf4453d 100644 --- a/product.json +++ b/product.json @@ -1,8 +1,8 @@ { "nameShort": "Void", "nameLong": "Void", - "voidVersion": "1.3.10", - "voidRelease": "0034", + "voidVersion": "1.4.0", + "voidRelease": "0035", "applicationName": "void", "dataFolderName": ".void-editor", "win32MutexName": "voideditor", From b74772e6e2ef87f858d7800946d50debe787443f Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 23:40:02 -0700 Subject: [PATCH 5/9] cmdCap --- src/vs/workbench/contrib/void/browser/terminalToolService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/void/browser/terminalToolService.ts b/src/vs/workbench/contrib/void/browser/terminalToolService.ts index 334bfa54..f9e0c791 100644 --- a/src/vs/workbench/contrib/void/browser/terminalToolService.ts +++ b/src/vs/workbench/contrib/void/browser/terminalToolService.ts @@ -297,11 +297,12 @@ export class TerminalToolService extends Disposable implements ITerminalToolServ const cmdCap = await this._waitForCommandDetectionCapability(terminal) - if (!cmdCap) throw new Error(`There was an error using the terminal: CommandDetection capability did not mount yet. Please try again in a few seconds or report this to the Void team.`) + // if (!cmdCap) throw new Error(`There was an error using the terminal: CommandDetection capability did not mount yet. Please try again in a few seconds or report this to the Void team.`) // Prefer the structured command-detection capability when available const waitUntilDone = new Promise(resolve => { + if (!cmdCap) return const l = cmdCap.onCommandFinished(cmd => { if (resolveReason) return // already resolved resolveReason = { type: 'done', exitCode: cmd.exitCode ?? 0 }; From e34e38cb3a1304769a2e4fa053dae657ba99ca38 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Fri, 30 May 2025 23:40:34 -0700 Subject: [PATCH 6/9] 1.4.1 --- product.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product.json b/product.json index 1cf4453d..da035bd9 100644 --- a/product.json +++ b/product.json @@ -1,8 +1,8 @@ { "nameShort": "Void", "nameLong": "Void", - "voidVersion": "1.4.0", - "voidRelease": "0035", + "voidVersion": "1.4.1", + "voidRelease": "0036", "applicationName": "void", "dataFolderName": ".void-editor", "win32MutexName": "voideditor", From 7eac4aad6f268b48c5d27c50404e8889cab5cbb7 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 5 Jun 2025 02:41:54 -0700 Subject: [PATCH 7/9] remove ugly button --- .../parts/editor/editorGroupWatermark.ts | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts index f9001e53..120223e4 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupWatermark.ts @@ -26,7 +26,6 @@ import { IViewsService } from '../../../services/views/common/viewsService.js'; /* eslint-disable */ // Void import { VOID_CTRL_K_ACTION_ID, VOID_CTRL_L_ACTION_ID } from '../../../contrib/void/browser/actionIDs.js'; -import { VOID_OPEN_SETTINGS_ACTION_ID } from '../../../contrib/void/browser/voidSettingsPane.js'; import { VIEWLET_ID as REMOTE_EXPLORER_VIEWLET_ID } from '../../../contrib/remote/browser/remoteExplorer.js'; /* eslint-enable */ @@ -306,21 +305,21 @@ export class EditorGroupWatermark extends Disposable { label2.set(keys2); this.currentDisposables.add(label2); - const keys3 = this.keybindingService.lookupKeybinding('workbench.action.openGlobalKeybindings'); - const button3 = append(recentsBox, $('button')); - button3.textContent = `Void Settings` - button3.style.display = 'block' - button3.style.marginLeft = 'auto' - button3.style.marginRight = 'auto' - button3.classList.add('void-settings-watermark-button') + // const keys3 = this.keybindingService.lookupKeybinding('workbench.action.openGlobalKeybindings'); + // const button3 = append(recentsBox, $('button')); + // button3.textContent = `Void Settings` + // button3.style.display = 'block' + // button3.style.marginLeft = 'auto' + // button3.style.marginRight = 'auto' + // button3.classList.add('void-settings-watermark-button') - const label3 = new KeybindingLabel(button3, OS, { renderUnboundKeybindings: true, ...defaultKeybindingLabelStyles }); - if (keys3) - label3.set(keys3); - button3.onclick = () => { - this.commandService.executeCommand(VOID_OPEN_SETTINGS_ACTION_ID) - } - this.currentDisposables.add(label3); + // const label3 = new KeybindingLabel(button3, OS, { renderUnboundKeybindings: true, ...defaultKeybindingLabelStyles }); + // if (keys3) + // label3.set(keys3); + // button3.onclick = () => { + // this.commandService.executeCommand(VOID_OPEN_SETTINGS_ACTION_ID) + // } + // this.currentDisposables.add(label3); } From 77c9284df5694c5d0f017d486bbab00027e01bbc Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 5 Jun 2025 02:41:58 -0700 Subject: [PATCH 8/9] fix ssh? --- .../workbench/contrib/void/browser/toolsService.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts index 6d56bd46..0d32db3c 100644 --- a/src/vs/workbench/contrib/void/browser/toolsService.ts +++ b/src/vs/workbench/contrib/void/browser/toolsService.ts @@ -42,8 +42,16 @@ const validateStr = (argName: string, value: unknown) => { const validateURI = (uriStr: unknown) => { if (uriStr === null) throw new Error(`Invalid LLM output: uri was null.`) if (typeof uriStr !== 'string') throw new Error(`Invalid LLM output format: Provided uri must be a string, but it's a(n) ${typeof uriStr}. Full value: ${JSON.stringify(uriStr)}.`) - const uri = URI.file(uriStr) - return uri + + // Try to parse as full URI first (for remote schemes like ssh://, wsl://, etc.) + try { + const uri = URI.parse(uriStr) + return uri + } catch (e) { + // If parsing as URI fails, treat as file path (backwards compatibility) + const uri = URI.file(uriStr) + return uri + } } const validateOptionalURI = (uriStr: unknown) => { From aacae4728f58dbdc5bf6e06a37b487d5b82cb147 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 5 Jun 2025 02:47:07 -0700 Subject: [PATCH 9/9] 1.4.2 version bump --- product.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product.json b/product.json index da035bd9..2a17a2a9 100644 --- a/product.json +++ b/product.json @@ -1,8 +1,8 @@ { "nameShort": "Void", "nameLong": "Void", - "voidVersion": "1.4.1", - "voidRelease": "0036", + "voidVersion": "1.4.2", + "voidRelease": "0037", "applicationName": "void", "dataFolderName": ".void-editor", "win32MutexName": "voideditor",