From 9d3bb4e8bd13db6bed3aba11f545b2a7e3510306 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 13 Mar 2026 19:29:30 -0700 Subject: [PATCH] Add setting for view image tool (#4406) * Add setting for view image tool * Fix ci --- extensions/copilot/package.json | 12 +++++++++++- extensions/copilot/package.nls.json | 1 + .../configuration/common/configurationService.ts | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extensions/copilot/package.json b/extensions/copilot/package.json index e5270e16f26..8f4de4e14c9 100644 --- a/extensions/copilot/package.json +++ b/extensions/copilot/package.json @@ -380,6 +380,7 @@ "toolReferenceName": "viewImage", "displayName": "%copilot.tools.viewImage.name%", "userDescription": "%copilot.tools.viewImage.userDescription%", + "when": "config.github.copilot.chat.tools.viewImage.enabled", "modelDescription": "View the contents of an image file. Use this instead of read_file for supported image files such as png, jpg, jpeg, gif, and webp. The tool returns the image directly to multimodal models and does not take line ranges or offsets.", "inputSchema": { "type": "object", @@ -3163,6 +3164,15 @@ "preview" ] }, + "github.copilot.chat.tools.viewImage.enabled": { + "type": "boolean", + "default": true, + "markdownDescription": "%github.copilot.config.tools.viewImage.enabled%", + "tags": [ + "preview", + "onExp" + ] + }, "github.copilot.chat.anthropic.thinking.budgetTokens": { "type": "number", "markdownDescription": "%github.copilot.config.anthropic.thinking.budgetTokens%", @@ -6222,4 +6232,4 @@ "zod": "3.25.76" }, "vscodeCommit": "6f7de9c47ab13c3d886928c04c382d527c9bf11d" -} +} \ No newline at end of file diff --git a/extensions/copilot/package.nls.json b/extensions/copilot/package.nls.json index 38476248836..43f85fce7c5 100644 --- a/extensions/copilot/package.nls.json +++ b/extensions/copilot/package.nls.json @@ -296,6 +296,7 @@ "copilot.tools.readFile.userDescription": "Read the contents of a file", "copilot.tools.viewImage.name": "View Image", "copilot.tools.viewImage.userDescription": "View the contents of an image file", + "github.copilot.config.tools.viewImage.enabled": "Enable the view image tool, which allows the agent to view image files such as png, jpg, jpeg, gif, and webp.", "copilot.tools.listDirectory.name": "List Dir", "copilot.tools.listDirectory.userDescription": "List the contents of a directory", "copilot.tools.getTaskOutput.name": "Get Task Output", diff --git a/extensions/copilot/src/platform/configuration/common/configurationService.ts b/extensions/copilot/src/platform/configuration/common/configurationService.ts index a353534c342..36168fc1f6f 100644 --- a/extensions/copilot/src/platform/configuration/common/configurationService.ts +++ b/extensions/copilot/src/platform/configuration/common/configurationService.ts @@ -976,6 +976,7 @@ export namespace ConfigKey { export const CopilotMemoryEnabled = defineSetting('chat.copilotMemory.enabled', ConfigType.ExperimentBased, false); export const MemoryToolEnabled = defineSetting('chat.tools.memory.enabled', ConfigType.ExperimentBased, true); + export const ViewImageToolEnabled = defineSetting('chat.tools.viewImage.enabled', ConfigType.ExperimentBased, true); } export function getAllConfigKeys(): string[] {