fix(codebase_search): disable vector retriever to prevent hang
Some checks are pending
CI / detect-changes (push) Waiting to run
CI / docs-check (push) Blocked by required conditions
CI / lint (push) Blocked by required conditions
CI / build (push) Blocked by required conditions
CI / integration-tests (push) Blocked by required conditions
CI / windows-portability (push) Blocked by required conditions
CI / rtk-portability (linux, blacksmith-4vcpu-ubuntu-2404) (push) Blocked by required conditions
CI / rtk-portability (macos, macos-15) (push) Blocked by required conditions
CI / rtk-portability (windows, blacksmith-4vcpu-windows-2025) (push) Blocked by required conditions

The vector retriever in sift hangs indefinitely during embedding model
inference, causing all codebase_search calls to timeout. Apply the same
fix as sift_search: restrict retrievers to bm25+phrase and disable ML
reranking.

- buildCodebaseSearchArgs: add --retrievers bm25,phrase --reranking none
- Update tool description from (BM25 + Vector) to (BM25 + phrase)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-15 10:13:31 +02:00
parent 1a98d8f9af
commit d90ac1fd69

View file

@ -161,7 +161,22 @@ function isCodebaseSearchError(details) {
* Consumer: `codebase_search.execute`. * Consumer: `codebase_search.execute`.
*/ */
function buildCodebaseSearchArgs(strategy, query, scope) { function buildCodebaseSearchArgs(strategy, query, scope) {
return ["search", "--strategy", strategy, "--agent", query, scope]; // Restrict retrievers to bm25+phrase and disable ML reranking to avoid
// the vector retriever hang where embedding model inference stalls forever
// (#vector-hang-fix). This gives fast lexical results without the broken
// semantic path.
return [
"search",
"--strategy",
strategy,
"--retrievers",
"bm25,phrase",
"--reranking",
"none",
"--agent",
query,
scope,
];
} }
function formatUsageStats(usage, model) { function formatUsageStats(usage, model) {
const parts = []; const parts = [];
@ -2502,7 +2517,7 @@ export default function (pi) {
name: "codebase_search", name: "codebase_search",
label: "Code Search", label: "Code Search",
description: [ description: [
"Perform Sift-backed hybrid (BM25 + Vector) retrieval over a scoped codebase path.", "Perform Sift-backed hybrid (BM25 + phrase) retrieval over a scoped codebase path.",
" Use this for conceptual, behavioral, or cross-cutting questions only after choosing a narrow scope", " Use this for conceptual, behavioral, or cross-cutting questions only after choosing a narrow scope",
" (e.g. 'how is X handled?', 'where is the logic for Y?', 'find examples of Z').", " (e.g. 'how is X handled?', 'where is the logic for Y?', 'find examples of Z').",
" If Sift status is degraded or the scope is broad, prefer grep/find/ls and retry with a narrower scope.", " If Sift status is degraded or the scope is broad, prefer grep/find/ls and retry with a narrower scope.",