fix: Improve LLM empty response handling with clearer warning messages

This commit is contained in:
Paul Gauthier 2025-03-06 13:07:27 -08:00 committed by Paul Gauthier (aider)
parent 012afc0708
commit 204a88c171
2 changed files with 8 additions and 4 deletions

View file

@ -1721,7 +1721,7 @@ class Coder:
def show_send_output_stream(self, completion):
received_content = False
for chunk in completion:
if len(chunk.choices) == 0:
continue
@ -1765,9 +1765,9 @@ class Coder:
sys.stdout.write(safe_text)
sys.stdout.flush()
yield text
if not received_content:
self.io.tool_warning("Empty response received from LLM.")
self.io.tool_warning("Empty response received from LLM. Check your provider account?")
def live_incremental_response(self, final):
show_resp = self.render_incremental_response(final)