Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ logs
.qodo/
.vercel
.roo/mcp.json

# Ignore temporary clones
tmp/
2 changes: 1 addition & 1 deletion src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
return SYSTEM_PROMPT(
provider.context,
this.cwd,
(this.api.getModel().info.supportsComputerUse ?? false) && (browserToolEnabled ?? true),
(this.api.getModel().info.supportsImages ?? false) && (browserToolEnabled ?? true),
mcpHub,
this.diffStrategy,
browserViewportSize,
Expand Down
10 changes: 5 additions & 5 deletions src/core/webview/generateSystemPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
const rooIgnoreInstructions = provider.getCurrentTask()?.rooIgnoreController?.getInstructions()

// Determine if browser tools can be used based on model support, mode, and user settings
let modelSupportsComputerUse = false
let modelSupportsImages = false

// Create a temporary API handler to check if the model supports computer use
// Create a temporary API handler to check if the model supports images (needed for screenshot-driven browsing)
// This avoids relying on an active Cline instance which might not exist during preview
try {
const tempApiHandler = buildApiHandler(apiConfiguration)
modelSupportsComputerUse = tempApiHandler.getModel().info.supportsComputerUse ?? false
modelSupportsImages = tempApiHandler.getModel().info.supportsImages ?? false
} catch (error) {
console.error("Error checking if model supports computer use:", error)
console.error("Error checking if model supports images:", error)
}

// Check if the current mode includes the browser tool group
Expand All @@ -62,7 +62,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web

// Only enable browser tools if the model supports it, the mode includes browser tools,
// and browser tools are enabled in settings
const canUseBrowserTool = modelSupportsComputerUse && modeSupportsBrowser && (browserToolEnabled ?? true)
const canUseBrowserTool = modelSupportsImages && modeSupportsBrowser && (browserToolEnabled ?? true)

const systemPrompt = await SYSTEM_PROMPT(
provider.context,
Expand Down
Loading
Loading