File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -29,28 +29,32 @@ export async function codebaseSearchTool(
2929 let query : string | undefined = block . params . query
3030 let directoryPrefix : string | undefined = block . params . path
3131
32- if ( ! query ) {
33- cline . consecutiveMistakeCount ++
34- pushToolResult ( await cline . sayAndCreateMissingParamError ( toolName , "query" ) )
35- return
36- }
3732 query = removeClosingTag ( "query" , query )
3833
3934 if ( directoryPrefix ) {
4035 directoryPrefix = removeClosingTag ( "path" , directoryPrefix )
4136 directoryPrefix = path . normalize ( directoryPrefix )
4237 }
4338
44- // Extract optional sendResultsToUI parameter
45-
46- const approvalPayload = {
39+ const sharedMessageProps = {
4740 tool : "codebaseSearch" ,
4841 query : query ,
4942 path : directoryPrefix ,
5043 isOutsideWorkspace : false ,
5144 }
5245
53- const didApprove = await askApproval ( "tool" , JSON . stringify ( approvalPayload ) )
46+ if ( block . partial ) {
47+ await cline . ask ( "tool" , JSON . stringify ( sharedMessageProps ) , block . partial ) . catch ( ( ) => { } )
48+ return
49+ }
50+
51+ if ( ! query ) {
52+ cline . consecutiveMistakeCount ++
53+ pushToolResult ( await cline . sayAndCreateMissingParamError ( toolName , "query" ) )
54+ return
55+ }
56+
57+ const didApprove = await askApproval ( "tool" , JSON . stringify ( sharedMessageProps ) )
5458 if ( ! didApprove ) {
5559 pushToolResult ( formatResponse . toolDenied ( ) )
5660 return
You can’t perform that action at this time.
0 commit comments