From d90ac1fd697773f95589faf06de335a667120129 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Fri, 15 May 2026 10:13:31 +0200 Subject: [PATCH] fix(codebase_search): disable vector retriever to prevent hang 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> --- src/resources/extensions/sf/subagent/index.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/resources/extensions/sf/subagent/index.js b/src/resources/extensions/sf/subagent/index.js index e7d21d0f6..dc73adff2 100644 --- a/src/resources/extensions/sf/subagent/index.js +++ b/src/resources/extensions/sf/subagent/index.js @@ -161,7 +161,22 @@ function isCodebaseSearchError(details) { * Consumer: `codebase_search.execute`. */ 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) { const parts = []; @@ -2502,7 +2517,7 @@ export default function (pi) { name: "codebase_search", label: "Code Search", 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", " (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.",