Skip to content

Conversation

Copy link

Copilot AI commented Jan 29, 2026

Description

Ported web_search tool from cline/cline, adapted to Roo-Code's architecture. Tool performs web searches via CloudAPI with optional domain filtering.

Implementation:

  • Type system: Added web_search to ToolName enum, NativeToolArgs, and ClineSayTool interface
  • Tool definition: Created OpenAI function spec in native-tools/web_search.ts with query (required) and domain filter params
  • Tool class: WebSearchTool extends BaseTool, validates mutual exclusivity of allowed/blocked domains
  • API integration: Added CloudAPI.webSearch() calling /api/v1/search/websearch endpoint
  • Execution pipeline: Integrated into presentAssistantMessage with description and execution cases
  • Tool grouping: Added to read tool group (read-only operation)

Key decisions:

  • Uses CloudService singleton pattern (not provider injection) for API access
  • Validates domain filter mutual exclusivity before approval to fail fast
  • Follows error tracking pattern: consecutiveMistakeCount, recordToolError, didToolFailInCurrentTurn

Example usage:

// Tool call with domain filtering
{
  name: "web_search",
  query: "latest TypeScript features",
  blocked_domains: ["ads.com", "spam.com"]
}

Test Procedure

TypeScript compilation verified across all affected packages (types, cloud, src). Manual testing requires:

  1. VSCode extension running with authenticated CloudService
  2. Invoke web_search tool with test query
  3. Verify search results displayed in task panel
  4. Test domain filtering behavior
  5. Confirm error handling when CloudService unavailable

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - Backend API integration, no UI changes

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required. (Tool should be documented in user-facing tool reference once enabled)

Additional Notes

  • CodeQL security scan: No vulnerabilities detected
  • Tool follows same patterns as fetch_instructions and other read-only tools
  • Domain filtering validation prevents API errors by failing at tool validation stage
  • CloudService availability checked post-approval to maintain consistent approval UX

Get in Touch

N/A

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v15.0.0
    • Triggering command: /usr/local/bin/node node ./lib/postinstall.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Pull over the web search tool from cline/cline and rework it to work with our repo.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@roomote
Copy link
Contributor

roomote bot commented Jan 29, 2026

Rooviewer Clock   See task on Roo Cloud

Reviewed commit 9114e64 which adds proper error tracking for CloudService unavailability. The error tracking implementation looks correct. The 2 previously flagged semantic correctness issues remain unaddressed.

  • Use query instead of path in execute() approval message (WebSearchTool.ts:46)
  • Use query instead of path in handlePartial() message (WebSearchTool.ts:115)
Previous reviews

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

Copilot AI and others added 2 commits January 29, 2026 14:39
// Create message for approval
const completeMessage = JSON.stringify({
tool: "webSearch",
path: query,
Copy link
Contributor

Choose a reason for hiding this comment

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

The ClineSayTool interface has a dedicated query property for search queries (see line 824 in vscode-extension-host.ts), but this code uses path instead. Using path is semantically incorrect since it typically represents file paths in this interface. This could cause confusion in the UI layer when displaying tool approval dialogs.

Suggested change
path: query,
query,

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

const query: string | undefined = block.params.query
const sharedMessageProps: ClineSayTool = {
tool: "webSearch",
path: query ?? "",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue as above: using path instead of query. The ClineSayTool interface has a dedicated query property that should be used here for semantic correctness.

Suggested change
path: query ?? "",
query: query ?? "",

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

Copilot AI changed the title [WIP] Rework web search tool for compatibility with our repo Implement web_search tool from cline/cline Jan 29, 2026
Copilot AI requested a review from hannesrudolph January 29, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants