Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lua/codecompanion/strategies/inline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,22 @@ function Inline:done(output)
log:error("[%s] %s", adapter_name, xml.error)
return self:reset()
end
if xml and not xml.code and string.lower(xml.placement) ~= "chat" then
log:error("[%s] Returned no code", adapter_name)
return self:reset()
end

-- There should always be a placement whether that's from the LLM or the user's prompt
local placement = xml and string.lower(xml.placement) or string.lower(self.classification.placement)
log:debug("[Inline] Placement: %s", placement)
if not placement then
log:error("[%s] No placement returned", adapter_name)
return self:reset()
end

log:debug("[Inline] Placement: %s", placement)

-- An LLM won't send code if it deems the placement should go to a chat buffer
if xml and not xml.code and placement ~= "chat" then
log:error("[%s] Returned no code", adapter_name)
return self:reset()
end

if placement == "chat" then
self:reset()
return self:to_chat()
Expand Down