diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index ae704b522..1a83a479b 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -653,6 +653,10 @@ class Coder: live.start() for chunk in completion: + text = '' + if len(chunk.choices) == 0: + continue + if chunk.choices[0].finish_reason == "length": raise ExhaustedContextWindow()