refactor: Move reasoning content flags initialization to send method

This commit is contained in:
Paul Gauthier 2025-03-07 17:15:44 -08:00 committed by Paul Gauthier (aider)
parent 794072bdf8
commit 80de3335b7
2 changed files with 5 additions and 2 deletions

View file

@ -1315,8 +1315,6 @@ class Coder:
litellm_ex = LiteLLMExceptions()
self.got_reasoning_content = False
self.ended_reasoning_content = False
self.usage_report = None
exhausted = False
interrupted = False
@ -1644,6 +1642,9 @@ class Coder:
return prompts.added_files.format(fnames=", ".join(added_fnames))
def send(self, messages, model=None, functions=None):
self.got_reasoning_content = False
self.ended_reasoning_content = False
if not model:
model = self.main_model

View file

@ -131,6 +131,8 @@ class TestReasoning(unittest.TestCase):
# Verify mdstream.update was called multiple times
mock_mdstream.update.assert_called()
coder.live_incremental_response(True)
# Explicitly get all calls to update
update_calls = mock_mdstream.update.call_args_list