File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
lua/codecompanion/strategies/chat/tools Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -352,8 +352,7 @@ function Tools:run()
352352 end
353353 end
354354
355- -- Delay executing the job to allow for output to be collated and processed
356- self .chat .current_tool = Job :new ({
355+ local new_job = Job :new ({
357356 command = vim .fn .has (" win32" ) == 1 and " cmd.exe" or " sh" ,
358357 args = { vim .fn .has (" win32" ) == 1 and " /c" or " -c" , table.concat (cmd .cmd or cmd , " " ) },
359358 enable_recording = true ,
@@ -418,7 +417,18 @@ function Tools:run()
418417 run (index + 1 , data )
419418 end )
420419 end ,
421- }):start ()
420+ })
421+
422+ if self .chat .current_tool then
423+ -- Chain to the previous job if it exists
424+ self .chat .current_tool :and_then_wrap (new_job )
425+ else
426+ -- Start first job directly
427+ new_job :start ()
428+ end
429+
430+ -- Update current_tool reference
431+ self .chat .current_tool = new_job
422432 end
423433 end
424434
You can’t perform that action at this time.
0 commit comments