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>
This commit is contained in:
NaccOll 2025-08-15 06:17:14 +08:00 committed by GitHub
parent 57389bff36
commit 3f4af18bf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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