Skip to content

WebSearch tool returns 'did 0 searches' when used with Claude Code #169

@vinopm

Description

@vinopm

Description

When using copilot-api with Claude Code, the WebSearch tool returns "did 0 searches" and fails to perform any web searches.

Environment

  • copilot-api version: latest
  • Client: Claude Code CLI
  • GitHub Copilot subscription: Active

Steps to Reproduce

  1. Start copilot-api server
  2. Configure Claude Code to use copilot-api as the API endpoint
  3. Ask Claude Code a question that triggers the WebSearch tool (e.g., "Search the web for the latest Node.js LTS version")
  4. Observe that the response indicates "did 0 searches"

Expected Behavior

Web search should return results, similar to how it works in VS Code Copilot Chat with @github #web or when Bing search is enabled.

Actual Behavior

The WebSearch tool is passed through as a regular function tool, but GitHub Copilot doesn't recognize or execute it, resulting in no searches being performed.

Root Cause Analysis

Based on research, GitHub Copilot's web search works differently than expected:

  1. Bing Search is server-side: When "Copilot Access to Bing" is enabled in GitHub settings, Copilot automatically triggers Bing search based on query context - it's NOT exposed as an explicit function/tool call in the API.

  2. VS Code's #fetch tool is client-side: The #fetch tool in VS Code Copilot Chat is executed locally by VS Code, not by the Copilot API.

  3. Current behavior: copilot-api translates Claude Code's WebSearch tool to an OpenAI-style function tool, but Copilot API doesn't recognize it as its own internal capability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions