Describe the bug:
When attempting to generate a commit message using the generateCommitMessage function, if the HTTP call to the OpenAI API is made with an invalid address, the call does not timeout. This causes the VSCode extension to hang, requiring a reload of VSCode for the extension to function again.
Additional context:
The issue seems to be related to the lack of a timeout configuration in the HTTP request made by the OpenAI client. Without a timeout, the request hangs indefinitely if the address is invalid or unreachable, leading to the extension becoming unresponsive.
Solution:
To resolve this issue, a timeout should be added to the HTTP request configuration in the generateCommitMessage function. This will ensure that the request fails gracefully after a specified period, allowing the extension to handle the error and remain responsive.
Describe the bug:
When attempting to generate a commit message using the
generateCommitMessagefunction, if the HTTP call to the OpenAI API is made with an invalid address, the call does not timeout. This causes the VSCode extension to hang, requiring a reload of VSCode for the extension to function again.Additional context:
The issue seems to be related to the lack of a timeout configuration in the HTTP request made by the OpenAI client. Without a timeout, the request hangs indefinitely if the address is invalid or unreachable, leading to the extension becoming unresponsive.
Solution:
To resolve this issue, a timeout should be added to the HTTP request configuration in the
generateCommitMessagefunction. This will ensure that the request fails gracefully after a specified period, allowing the extension to handle the error and remain responsive.