Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,16 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
mode,
customInstructions: globalInstructions,
experiments,
browserToolEnabled, // Get user preference for browser tool
} = await this.getState()

const modePrompt = customModePrompts?.[mode] as PromptComponent
const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")

// Check if browser tool is enabled by both model capability and user preference
const canUseBrowserTool =
(apiConfiguration.openRouterModelInfo?.supportsComputerUse ?? false) && (browserToolEnabled ?? true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannesrudolph this is just what we had before. didn't work as well. It checks only for Open Router, no? What if the user is not using open router?


const cline = new Cline({
provider: this,
apiConfiguration,
Expand Down Expand Up @@ -488,6 +493,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
mode,
customInstructions: globalInstructions,
experiments,
browserToolEnabled, // Make sure we also get browserToolEnabled here
} = await this.getState()

const modePrompt = customModePrompts?.[mode] as PromptComponent
Expand Down Expand Up @@ -1921,7 +1927,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
fuzzyMatchThreshold,
experiments,
enableMcpServerCreation,
browserToolEnabled,
browserToolEnabled, // Get user preference for browser tool
} = await this.getState()

// Create diffStrategy based on current model and settings
Expand All @@ -1937,14 +1943,14 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements

const rooIgnoreInstructions = this.getCurrentCline()?.rooIgnoreController?.getInstructions()

// Determine if browser tools can be used based on model support and user settings
const modelSupportsComputerUse = this.getCurrentCline()?.api.getModel().info.supportsComputerUse ?? false
const canUseBrowserTool = modelSupportsComputerUse && (browserToolEnabled ?? true)
// Check if browser tool is enabled by both model capability and user preference
const canUseBrowserTool =
(apiConfiguration.openRouterModelInfo?.supportsComputerUse ?? false) && (browserToolEnabled ?? true)

const systemPrompt = await SYSTEM_PROMPT(
this.context,
cwd,
canUseBrowserTool,
canUseBrowserTool, // Pass the combined value
mcpEnabled ? this.mcpHub : undefined,
diffStrategy,
browserViewportSize ?? "900x600",
Expand Down
Loading
Loading