File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
lua/codecompanion/strategies/inline Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -434,18 +434,22 @@ function Inline:done(output)
434434 log :error (" [%s] %s" , adapter_name , xml .error )
435435 return self :reset ()
436436 end
437- if xml and not xml .code and string.lower (xml .placement ) ~= " chat" then
438- log :error (" [%s] Returned no code" , adapter_name )
439- return self :reset ()
440- end
441437
438+ -- There should always be a placement whether that's from the LLM or the user's prompt
442439 local placement = xml and string.lower (xml .placement ) or string.lower (self .classification .placement )
443- log :debug (" [Inline] Placement: %s" , placement )
444440 if not placement then
445441 log :error (" [%s] No placement returned" , adapter_name )
446442 return self :reset ()
447443 end
448444
445+ log :debug (" [Inline] Placement: %s" , placement )
446+
447+ -- An LLM won't send code if it deems the placement should go to a chat buffer
448+ if xml and not xml .code and placement ~= " chat" then
449+ log :error (" [%s] Returned no code" , adapter_name )
450+ return self :reset ()
451+ end
452+
449453 if placement == " chat" then
450454 self :reset ()
451455 return self :to_chat ()
You can’t perform that action at this time.
0 commit comments