diff --git a/.changeset/long-masks-notice.md b/.changeset/long-masks-notice.md new file mode 100644 index 0000000000..76079fbed6 --- /dev/null +++ b/.changeset/long-masks-notice.md @@ -0,0 +1,5 @@ +--- +"claude-dev": minor +--- + +Advanced Setting to disable browser tool diff --git a/package.json b/package.json index 898e2b9edf..f78ffd3870 100644 --- a/package.json +++ b/package.json @@ -162,6 +162,11 @@ "default": true, "description": "Enables extension to save checkpoints of workspace throughout the task." }, + "cline.disableBrowserTool": { + "type": "boolean", + "default": false, + "description": "Disables extension from spawning browser session." + }, "cline.modelSettings.o3Mini.reasoningEffort": { "type": "string", "enum": [ diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 7d40127edf..127960f073 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1259,12 +1259,12 @@ export class Cline { throw new Error("MCP hub not available") } - let systemPrompt = await SYSTEM_PROMPT( - cwd, - this.api.getModel().info.supportsComputerUse ?? false, - mcpHub, - this.browserSettings, - ) + const disableBrowserTool = vscode.workspace.getConfiguration("cline").get("disableBrowserTool") ?? false + const modelSupportsComputerUse = this.api.getModel().info.supportsComputerUse ?? false + + const supportsComputerUse = modelSupportsComputerUse && !disableBrowserTool // only enable computer use if the model supports it and the user hasn't disabled it + + let systemPrompt = await SYSTEM_PROMPT(cwd, supportsComputerUse, mcpHub, this.browserSettings) let settingsCustomInstructions = this.customInstructions?.trim() const clineRulesFilePath = path.resolve(cwd, GlobalFileNames.clineRules) diff --git a/src/test/suite/extension.test.js b/src/test/suite/extension.test.js index f9d3305db0..a450fafa2a 100644 --- a/src/test/suite/extension.test.js +++ b/src/test/suite/extension.test.js @@ -34,4 +34,14 @@ describe("Extension Tests", function () { await vscode.commands.executeCommand("cline.historyButtonClicked") // Success if no error thrown }) + + it("should handle advanced settings configuration", async () => { + // Test browser session setting + await vscode.workspace.getConfiguration().update("cline.disableBrowserTool", true, true) + const updatedConfig = vscode.workspace.getConfiguration("cline") + expect(updatedConfig.get("disableBrowserTool")).to.be.true + + // Reset settings + await vscode.workspace.getConfiguration().update("cline.disableBrowserTool", undefined, true) + }) })