Skip to content

Conversation

@aSh-dev-io
Copy link

Title: fix -Unable to cancel LLM request in the new update #3992

This change fixes a regression where Ctrl+C failed to cancel an LLM request during the initial "Waiting on response..." phase. The cancellation only worked once the response started streaming, leading to a period where the application felt unresponsive.

To fix this, I've wrapped the initial, non-streaming litellm.completion call in its own try...except KeyboardInterrupt block. This ensures that user-initiated cancellations are handled immediately and consistently, whether the application is waiting for the first token or streaming the full response.

Title: fix -Unable to cancel LLM request in the new update Aider-AI#3992

This change fixes a regression where Ctrl+C failed to cancel an LLM request during the initial "Waiting on response..." phase. The cancellation only worked once the response started streaming, leading to a period where the application felt unresponsive.

To fix this, I've wrapped the initial, non-streaming litellm.completion call in its own try...except KeyboardInterrupt block. This ensures that user-initiated cancellations are handled immediately and consistently, whether the application is waiting for the first token or streaming the full response.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant