Skip to content

Commit 7b6a3d2

Browse files
Advanced Setting to enable browser session (RooCodeInc#1736)
* feat: add Advanced Setting to enable browser session * ensure browser tool is removed from system prompt * fix test * Update BrowserSession.ts * Update BrowserSession.ts --------- Co-authored-by: Saoud Rizwan <[email protected]>
1 parent 82eba4d commit 7b6a3d2

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

.changeset/long-masks-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
Advanced Setting to disable browser tool

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@
162162
"default": true,
163163
"description": "Enables extension to save checkpoints of workspace throughout the task."
164164
},
165+
"cline.disableBrowserTool": {
166+
"type": "boolean",
167+
"default": false,
168+
"description": "Disables extension from spawning browser session."
169+
},
165170
"cline.modelSettings.o3Mini.reasoningEffort": {
166171
"type": "string",
167172
"enum": [

src/core/Cline.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,12 +1259,12 @@ export class Cline {
12591259
throw new Error("MCP hub not available")
12601260
}
12611261

1262-
let systemPrompt = await SYSTEM_PROMPT(
1263-
cwd,
1264-
this.api.getModel().info.supportsComputerUse ?? false,
1265-
mcpHub,
1266-
this.browserSettings,
1267-
)
1262+
const disableBrowserTool = vscode.workspace.getConfiguration("cline").get<boolean>("disableBrowserTool") ?? false
1263+
const modelSupportsComputerUse = this.api.getModel().info.supportsComputerUse ?? false
1264+
1265+
const supportsComputerUse = modelSupportsComputerUse && !disableBrowserTool // only enable computer use if the model supports it and the user hasn't disabled it
1266+
1267+
let systemPrompt = await SYSTEM_PROMPT(cwd, supportsComputerUse, mcpHub, this.browserSettings)
12681268

12691269
let settingsCustomInstructions = this.customInstructions?.trim()
12701270
const clineRulesFilePath = path.resolve(cwd, GlobalFileNames.clineRules)

src/test/suite/extension.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ describe("Extension Tests", function () {
3434
await vscode.commands.executeCommand("cline.historyButtonClicked")
3535
// Success if no error thrown
3636
})
37+
38+
it("should handle advanced settings configuration", async () => {
39+
// Test browser session setting
40+
await vscode.workspace.getConfiguration().update("cline.disableBrowserTool", true, true)
41+
const updatedConfig = vscode.workspace.getConfiguration("cline")
42+
expect(updatedConfig.get("disableBrowserTool")).to.be.true
43+
44+
// Reset settings
45+
await vscode.workspace.getConfiguration().update("cline.disableBrowserTool", undefined, true)
46+
})
3747
})

0 commit comments

Comments
 (0)