Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 13, 2026

Motivation

  • Provide a web search tool so the assistant can retrieve up-to-date external information similar to Cline's websearch capability.
  • Expose web search as a native tool so models can call it via function/tool calling and receive structured results.
  • Integrate web search into the system prompt/tool catalog and UI so it is discoverable and follows existing tool approval/workflow.

Description

  • Implemented WebSearchTool at src/core/tools/WebSearchTool.ts which queries DuckDuckGo JSON API, normalizes results, enforces timeouts and max_results, and uses the existing approval/result push flow.
  • Registered web_search in types and shared tool registries (packages/types/src/tool.ts, src/shared/tools.ts) and added native tool schema (src/core/prompts/tools/native-tools/web_search.ts) and XML-style description (src/core/prompts/tools/web-search.ts).
  • Wired execution into the tool dispatch path (presentAssistantMessage) and added filtering so web_search is included in the browser group and respects browserToolEnabled settings.
  • Updated UI and CLI renderers and localization to surface web search asks/results (webview-ui/src/components/chat/ChatRow.tsx, many webview-ui locale files, apps/cli renderer files).

Testing

  • Ran repository lint via turbo lint --log-order grouped --output-logs new-only as part of the commit hooks and the lint step completed successfully.
  • Pre-commit formatting and repository tasks ran as part of the commit flow and completed without errors.

Codex Task


Important

Introduces WebSearchTool for real-time web searches via DuckDuckGo, integrating it into the system's tool dispatch and UI components.

  • Behavior:
    • Adds WebSearchTool in WebSearchTool.ts to query DuckDuckGo API, normalize results, enforce timeouts, and handle max_results.
    • Integrates web_search into tool dispatch in presentAssistantMessage and respects browserToolEnabled settings.
  • Tool Registration:
    • Registers web_search in tool.ts, vscode-extension-host.ts, and shared/tools.ts.
    • Adds native tool schema in native-tools/web_search.ts and description in web-search.ts.
  • UI Updates:
    • Updates ChatRow.tsx to display web search results.
    • Adds localization for web search in multiple locale files.
  • Testing:
    • Linting and formatting checks passed successfully.

This description was created by Ellipsis for f215437. You can customize this summary. It will automatically update as commits are pushed.

@roomote
Copy link
Contributor

roomote bot commented Jan 13, 2026

Oroocle Clock   See task on Roo Cloud

Review completed. Flagged a couple of small inconsistencies to address before merging.

  • Make web_search native schema match docs: max_results should be optional (remove from required).
  • Align CLI tool categorization for web_search (currently treated as browser-disabled tool, but shown as search in CLI).

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

description: MAX_RESULTS_PARAMETER_DESCRIPTION,
},
},
required: ["query", "max_results"],
Copy link
Contributor

Choose a reason for hiding this comment

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

max_results is described as optional, but the native tool schema marks it as required (required: ["query", "max_results"]). With strict: true, this forces the model to always send max_results and can lead to validation failures if it omits it. Consider removing max_results from required and keeping the runtime defaulting in the tool implementation.

Fix it with Roo Code or mention @roomote and request a fix.

const dirTools = ["listFiles", "list_files", "listFilesRecursive", "listFilesTopLevel"]
const searchTools = ["searchFiles", "search_files"]
const searchTools = ["searchFiles", "search_files", "webSearch", "web_search"]
const commandTools = ["executeCommand", "execute_command"]
Copy link
Contributor

Choose a reason for hiding this comment

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

web_search is treated as a browser tool in filtering (browserToolEnabled) and grouped under browser, but it is categorized as a search tool in the CLI UI. This mismatch is confusing for users and makes browser enable/disable semantics harder to reason about. Consider categorizing webSearch/web_search under the browser tool group in the CLI UI as well.

Fix it with Roo Code or mention @roomote and request a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants