A lightweight, reliable bridge extension for VS Code that exposes the workspace codebase semantic search tool (semanticSearch) to all AI Agents. It enables third-party and custom model endpoints (e.g., DeepSeek, Claude, Gemini, local models) to autonomously perform semantic code retrieval across your workspace.
🌟 Key Features
Autonomous Semantic Search Tool (semanticSearch):
Unified Tool Name & Reference: Both tool registration name and prompt reference are identical: semanticSearch.
Inputs:
query (string, required): Natural language description or functional intent (e.g., "user authentication interceptor", "websocket heartbeat mechanism").
scopedDirectories (string[], optional): Filter search scope to specific directories.
Transparently relays requests to Copilot's underlying copilot_searchCodebase service for high-quality code snippets.
Lossless AST Unwrapping & Graceful Degradation:
Deeply traverses @vscode/prompt-tsx AST trees (up to 48 layers) to extract code excerpts 100% losslessly without arbitrary truncation.
Automatically provides actionable English fallback guidance when the codebase index is not yet built or returns empty, guiding the Agent to immediately use grep_search or file_search instead of looping indefinitely.
Minimalist Status Bar & Index Management:
Binary Status Bar: Displays clean states: Ready ($(search) Semantic Search) and Building ($(sync~spin) Semantic Search: Indexing...).
Quick Actions Menu: Click status bar item or open Command Palette to:
Semantic Search: Build Codebase Index (trigger Copilot codebase index build with concurrency protection)
Semantic Search: Collect Index Diagnostics (generate instant diagnostic report)
Semantic Search: Open Management Menu
Highly Configurable:
semanticSearch.timeoutMs: Timeout threshold for single relay search (default 45000 ms).
semanticSearch.statusBar.enabled: Toggle status bar entry visibility.
semanticSearch.showDegradationHints: Toggle whether to append fallback suggestions on empty or failed searches.
semanticSearch.relayToolId: Target underlying tool ID (default copilot_searchCodebase).
📖 Usage
1. Prerequisites
Install and enable the GitHub Copilot Chat extension (provides underlying embedding and index services);
Build the codebase semantic index for your workspace (via the status bar entry or Command Palette Semantic Search: Build Codebase Index).
2. How to Use
Autonomous Agent Invocation: In any VS Code Agent / Chat conversation, models will automatically call the semanticSearch tool when searching for code by concept or logic;
Explicit Reference: Type #semanticSearch in the Chat input box to directly attach semantic search context.
简体中文
这是一个为 VS Code 设计的中继扩展插件,旨在将工作区代码语义检索工具(semanticSearch)开放给所有智能体(Agent),让使用第三方或兼容模型(如 DeepSeek、Gemini、Claude 等)的 Agent 能够自主调用工作区代码语义搜索能力。