From 3f4af18bf7df4b78fd24c836649459d864270aa3 Mon Sep 17 00:00:00 2001 From: NaccOll Date: Fri, 15 Aug 2025 06:17:14 +0800 Subject: [PATCH] fix: Use cline.cwd as primary source for workspace path in codebaseSearchTool (#6902) Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com> --- src/core/tools/codebaseSearchTool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tools/codebaseSearchTool.ts b/src/core/tools/codebaseSearchTool.ts index 236b066306..700d1b7c7c 100644 --- a/src/core/tools/codebaseSearchTool.ts +++ b/src/core/tools/codebaseSearchTool.ts @@ -17,7 +17,7 @@ export async function codebaseSearchTool( removeClosingTag: RemoveClosingTag, ) { const toolName = "codebase_search" - const workspacePath = getWorkspacePath() + const workspacePath = (cline.cwd && cline.cwd.trim() !== '') ? cline.cwd : getWorkspacePath() if (!workspacePath) { // This case should ideally not happen if Cline is initialized correctly