From c4f17fae2dadceeb1476a71d9abd58848814bd64 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:27:29 +0530 Subject: [PATCH] when no results were retrieved, use other tools - add the instruction prompt --- core/context/retrieval/retrieval.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/core/context/retrieval/retrieval.ts b/core/context/retrieval/retrieval.ts index 3b8e98427..8e89af7ad 100644 --- a/core/context/retrieval/retrieval.ts +++ b/core/context/retrieval/retrieval.ts @@ -24,6 +24,8 @@ export async function retrieveContextItemsFromEmbeddings( // } const includeEmbeddings = !!extras.config.selectedModelByRole.embed; + console.log("debug1 running retrieval"); + // Get tags to retrieve for const workspaceDirs = await extras.ide.getWorkspaceDirs(); @@ -70,25 +72,22 @@ export async function retrieveContextItemsFromEmbeddings( }; const pipeline = new pipelineType(pipelineOptions); - const results = await pipeline.run({ - tags, - filterDirectory, - query: extras.fullInput, - includeEmbeddings, - }); + const results = [] as any[]; if (results.length === 0) { if (extras.config.disableIndexing) { - void extras.ide.showToast("warning", "No results found."); - return []; - } else { void extras.ide.showToast( "warning", - "No results found. If you think this is an error, re-index your codebase.", + "No results found (Indexing disabled).", ); - // TODO - add "re-index" option to warning message which clears and reindexes codebase + return []; } - return []; + return [ + { + ...INSTRUCTIONS_BASE_ITEM, + content: "No results were found. Try using other tools.", + }, + ]; } return [