Skip to content

HTTP Call Doesn't Timeout with Invalid Address, Requires VSCode Reload #5

Description

@myinusa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions