Skip to content
Merged
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
8 changes: 0 additions & 8 deletions apps/cli/src/agent/__tests__/extension-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ describe("detectAgentState", () => {
expect(state.requiredAction).toBe("answer")
})

it("should detect waiting for browser_action_launch approval", () => {
const messages = [createMessage({ type: "ask", ask: "browser_action_launch", partial: false })]
const state = detectAgentState(messages)
expect(state.state).toBe(AgentLoopState.WAITING_FOR_INPUT)
expect(state.requiredAction).toBe("approve")
})

it("should detect waiting for use_mcp_server approval", () => {
const messages = [createMessage({ type: "ask", ask: "use_mcp_server", partial: false })]
const state = detectAgentState(messages)
Expand Down Expand Up @@ -202,7 +195,6 @@ describe("Type Guards", () => {
expect(isInteractiveAsk("tool")).toBe(true)
expect(isInteractiveAsk("command")).toBe(true)
expect(isInteractiveAsk("followup")).toBe(true)
expect(isInteractiveAsk("browser_action_launch")).toBe(true)
expect(isInteractiveAsk("use_mcp_server")).toBe(true)
})

Expand Down
5 changes: 1 addition & 4 deletions apps/cli/src/agent/agent-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export enum AgentLoopState {
*/
export type RequiredAction =
| "none" // No action needed (running/streaming)
| "approve" // Can approve/reject (tool, command, browser, mcp)
| "approve" // Can approve/reject (tool, command, mcp)
| "answer" // Need to answer a question (followup)
| "retry_or_new_task" // Can retry or start new task (api_req_failed)
| "proceed_or_new_task" // Can proceed or start new task (mistake_limit)
Expand Down Expand Up @@ -221,7 +221,6 @@ function getRequiredAction(ask: ClineAsk): RequiredAction {
return "answer"
case "command":
case "tool":
case "browser_action_launch":
case "use_mcp_server":
return "approve"
case "command_output":
Expand Down Expand Up @@ -264,8 +263,6 @@ function getStateDescription(state: AgentLoopState, ask?: ClineAsk): string {
return "Agent wants to execute a command. Approve or reject."
case "tool":
return "Agent wants to perform a file operation. Approve or reject."
case "browser_action_launch":
return "Agent wants to use the browser. Approve or reject."
case "use_mcp_server":
return "Agent wants to use an MCP server. Approve or reject."
default:
Expand Down
31 changes: 1 addition & 30 deletions apps/cli/src/agent/ask-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export class AskDispatcher {
}

/**
* Handle interactive asks (followup, command, tool, browser_action_launch, use_mcp_server).
* Handle interactive asks (followup, command, tool, use_mcp_server).
* These require user approval or input.
*/
private async handleInteractiveAsk(ts: number, ask: ClineAsk, text: string): Promise<AskHandleResult> {
Expand All @@ -258,9 +258,6 @@ export class AskDispatcher {
case "tool":
return await this.handleToolApproval(ts, text)

case "browser_action_launch":
return await this.handleBrowserApproval(ts, text)

case "use_mcp_server":
return await this.handleMcpApproval(ts, text)

Expand Down Expand Up @@ -444,32 +441,6 @@ export class AskDispatcher {
}
}

/**
* Handle browser action approval.
*/
private async handleBrowserApproval(ts: number, text: string): Promise<AskHandleResult> {
this.outputManager.output("\n[browser action request]")
if (text) {
this.outputManager.output(` Action: ${text}`)
}
this.outputManager.markDisplayed(ts, text || "", false)

if (this.nonInteractive) {
// Auto-approved by extension settings
return { handled: true }
}

try {
const approved = await this.promptManager.promptForYesNo("Allow browser action? (y/n): ")
this.sendApprovalResponse(approved)
return { handled: true, response: approved ? "yesButtonClicked" : "noButtonClicked" }
} catch {
this.outputManager.output("[Defaulting to: no]")
this.sendApprovalResponse(false)
return { handled: true, response: "noButtonClicked" }
}
}

/**
* Handle MCP server access approval.
*/
Expand Down
2 changes: 0 additions & 2 deletions apps/cli/src/agent/extension-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export class ExtensionHost extends EventEmitter implements ExtensionHostInterfac
const baseSettings: RooCodeSettings = {
mode: this.options.mode,
commandExecutionTimeout: 30,
browserToolEnabled: false,
enableCheckpoints: false,
...getProviderSettings(this.options.provider, this.options.apiKey, this.options.model),
}
Expand All @@ -227,7 +226,6 @@ export class ExtensionHost extends EventEmitter implements ExtensionHostInterfac
alwaysAllowWrite: true,
alwaysAllowWriteOutsideWorkspace: true,
alwaysAllowWriteProtected: true,
alwaysAllowBrowser: true,
alwaysAllowMcp: true,
alwaysAllowModeSwitch: true,
alwaysAllowSubtasks: true,
Expand Down
18 changes: 0 additions & 18 deletions apps/cli/src/agent/json-event-emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,6 @@ export class JsonEventEmitter {
break
}

case "browser_action":
case "browser_action_result":
this.emitEvent({
type: "tool_result",
subtype: "browser",
tool_result: { name: "browser_action", output: msg.text },
})
break

case "mcp_server_response":
this.emitEvent({
type: "tool_result",
Expand Down Expand Up @@ -336,15 +327,6 @@ export class JsonEventEmitter {
})
break

case "browser_action_launch":
this.emitEvent({
type: "tool_use",
id: msg.ts,
subtype: "browser",
tool_use: { name: "browser_action", input: { raw: msg.text } },
})
break

case "use_mcp_server":
this.emitEvent({
type: "tool_use",
Expand Down
5 changes: 1 addition & 4 deletions apps/cli/src/ui/components/ChatHistoryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ import { getToolRenderer } from "./tools/index.js"
/**
* Tool categories for styling
*/
type ToolCategory = "file" | "directory" | "search" | "command" | "browser" | "mode" | "completion" | "other"
type ToolCategory = "file" | "directory" | "search" | "command" | "mode" | "completion" | "other"

function getToolCategory(toolName: string): ToolCategory {
const fileTools = ["readFile", "read_file", "writeToFile", "write_to_file", "applyDiff", "apply_diff"]
const dirTools = ["listFiles", "list_files", "listFilesRecursive", "listFilesTopLevel"]
const searchTools = ["searchFiles", "search_files"]
const commandTools = ["executeCommand", "execute_command"]
const browserTools = ["browserAction", "browser_action"]
const modeTools = ["switchMode", "switch_mode", "newTask", "new_task"]
const completionTools = ["attemptCompletion", "attempt_completion", "askFollowupQuestion", "ask_followup_question"]

if (fileTools.includes(toolName)) return "file"
if (dirTools.includes(toolName)) return "directory"
if (searchTools.includes(toolName)) return "search"
if (commandTools.includes(toolName)) return "command"
if (browserTools.includes(toolName)) return "browser"
if (modeTools.includes(toolName)) return "mode"
if (completionTools.includes(toolName)) return "completion"
return "other"
Expand All @@ -39,7 +37,6 @@ const CATEGORY_COLORS: Record<ToolCategory, string> = {
directory: theme.toolHeader,
search: theme.warningColor,
command: theme.successColor,
browser: theme.focusColor,
mode: theme.userHeader,
completion: theme.successColor,
other: theme.toolHeader,
Expand Down
87 changes: 0 additions & 87 deletions apps/cli/src/ui/components/tools/BrowserTool.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/cli/src/ui/components/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { FileReadTool } from "./FileReadTool.js"
import { FileWriteTool } from "./FileWriteTool.js"
import { SearchTool } from "./SearchTool.js"
import { CommandTool } from "./CommandTool.js"
import { BrowserTool } from "./BrowserTool.js"
import { ModeTool } from "./ModeTool.js"
import { CompletionTool } from "./CompletionTool.js"
import { GenericTool } from "./GenericTool.js"
Expand All @@ -32,7 +31,6 @@ export { FileReadTool } from "./FileReadTool.js"
export { FileWriteTool } from "./FileWriteTool.js"
export { SearchTool } from "./SearchTool.js"
export { CommandTool } from "./CommandTool.js"
export { BrowserTool } from "./BrowserTool.js"
export { ModeTool } from "./ModeTool.js"
export { CompletionTool } from "./CompletionTool.js"
export { GenericTool } from "./GenericTool.js"
Expand All @@ -45,7 +43,6 @@ const CATEGORY_RENDERERS: Record<string, React.FC<ToolRendererProps>> = {
"file-write": FileWriteTool,
search: SearchTool,
command: CommandTool,
browser: BrowserTool,
mode: ModeTool,
completion: CompletionTool,
other: GenericTool,
Expand Down
12 changes: 1 addition & 11 deletions apps/cli/src/ui/components/tools/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ export interface ToolRendererProps {
rawContent?: string
}

export type ToolCategory =
| "file-read"
| "file-write"
| "search"
| "command"
| "browser"
| "mode"
| "completion"
| "other"
export type ToolCategory = "file-read" | "file-write" | "search" | "command" | "mode" | "completion" | "other"

export function getToolCategory(toolName: string): ToolCategory {
const fileReadTools = ["readFile", "read_file", "skill", "listFilesTopLevel", "listFilesRecursive", "list_files"]
Expand All @@ -29,15 +21,13 @@ export function getToolCategory(toolName: string): ToolCategory {

const searchTools = ["searchFiles", "search_files", "codebaseSearch", "codebase_search"]
const commandTools = ["execute_command", "executeCommand"]
const browserTools = ["browser_action", "browserAction"]
const modeTools = ["switchMode", "switch_mode", "newTask", "new_task", "finishTask"]
const completionTools = ["attempt_completion", "attemptCompletion", "ask_followup_question", "askFollowupQuestion"]

if (fileReadTools.includes(toolName)) return "file-read"
if (fileWriteTools.includes(toolName)) return "file-write"
if (searchTools.includes(toolName)) return "search"
if (commandTools.includes(toolName)) return "command"
if (browserTools.includes(toolName)) return "browser"
if (modeTools.includes(toolName)) return "mode"
if (completionTools.includes(toolName)) return "completion"
return "other"
Expand Down
8 changes: 0 additions & 8 deletions apps/cli/src/ui/components/tools/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export function getToolDisplayName(toolName: string): string {
execute_command: "Execute Command",
executeCommand: "Execute Command",

// Browser operations
browser_action: "Browser Action",
browserAction: "Browser Action",

// Mode operations
switchMode: "Switch Mode",
switch_mode: "Switch Mode",
Expand Down Expand Up @@ -129,10 +125,6 @@ export function getToolIconName(toolName: string): IconName {
execute_command: "terminal",
executeCommand: "terminal",

// Browser operations
browser_action: "browser",
browserAction: "browser",

// Mode operations
switchMode: "switch",
switch_mode: "switch",
Expand Down
8 changes: 0 additions & 8 deletions apps/cli/src/ui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ export interface ToolData {
/** Command output */
output?: string

// Browser operation fields
/** Browser action type */
action?: string
/** Browser URL */
url?: string
/** Click/hover coordinates */
coordinate?: string

// Batch operation fields
/** Batch file reads */
batchFiles?: Array<{
Expand Down
Loading
Loading