paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
16.61k stars 1.56k forks source link

Crash report, V18 #357

Closed 5ocworkshop closed 7 months ago

5ocworkshop commented 9 months ago

Upgraded earlier today. Amazing project. Thank you so much.

Using the gpt-4 1106 preview. It was in the process of providing a search/replace snippet and:

Ensure that the column names are formatted and escaped properly

columns_to_create = {format_and_escape_column_name(col_name): col_type for col_name, col_type in columns.items() if format_column_name(col_name) not in existing_column_names}
for safe_col_name, col_type in columns_to_create.items():
    alter_statement = f"ALTER TABLE {format_table_name(table_name)} ADD COLUMN {safe_col_name} {col_type};"
    try:
        cursorTraceback (most recent call last):

File "/home/jac/.local/bin/aider", line 8, in sys.exit(main()) ^^^^^^ File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/main.py", line 566, in main coder.run() File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/coders/base_coder.py", line 329, in run new_user_message = self.run_loop() ^^^^^^^^^^^^^^^ File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/coders/base_coder.py", line 412, in run_loop return self.send_new_user_message(inp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/coders/base_coder.py", line 466, in send_new_user_message interrupted = self.send(messages, functions=self.functions) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/coders/base_coder.py", line 590, in send self.show_send_output_stream(completion) File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/aider/coders/base_coder.py", line 669, in show_send_output_stream for chunk in completion: File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 168, in return ( ^ File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/openai/api_requestor.py", line 703, in self._interpret_response_line( File "/home/jac/.local/pipx/venvs/aider-chat/lib/python3.11/site-packages/openai/api_requestor.py", line 775, in _interpret_response_line raise self.handle_error_response( openai.error.APIError: Request failed due to server shutdown (Error occurred while streaming.)

Seemed like something that could be handled gracefully and reported back to the UI?

5ocworkshop commented 9 months ago

I don't know if this is new or not but I'm now seeing with V18 that I sometimes get this output in red in the console (I'm using VS Code native terminal which is using reduced colours): summarizer unexpectedly failed for gpt-3.5-turbo

I'm using the gpt-4 turbo 1106 api so not sure where the 3.5 reference comes from or is that an internal call?

paul-gauthier commented 7 months ago

We upgraded aider to the new openai client, so it's unlikely that this particular bug still happens.

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.