opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

[Bug]: 70 seconds delay before proceeding if using `ollama` option with no internet

Open hacker-hackman opened this issue 1 year ago • 1 comments

Opencommit Version

3.0.15

Node Version

20.9.0

NPM Version

10.1.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

This bug happens every time.

Expected Behavior

Generate a commit message instantly if disconnected from internet.

Current Behavior

opencommit waits 70 seconds before generating a commit message if disconnected from internet and using ollama option.

Possible Solution

I think there's an internet connection timeout set. And we need to place ollama execution before this timeout.

Steps to Reproduce

  1. Disable your internet connection
  2. Use my config:
OCO_OPENAI_API_KEY=undefined
OCO_ANTHROPIC_API_KEY=undefined
OCO_TOKENS_MAX_INPUT=undefined
OCO_TOKENS_MAX_OUTPUT=undefined
OCO_OPENAI_BASE_PATH=undefined
OCO_DESCRIPTION=false
OCO_EMOJI=false
OCO_MODEL=undefined
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_AI_PROVIDER=ollama
OCO_GITPUSH=false
OCO_ONE_LINE_COMMIT=false
  1. Install ollama and pull mistral model from the library
  2. try to use oco command to make a commit

Relevant log output

No response

hacker-hackman avatar May 23 '24 07:05 hacker-hackman

@hacker-hackman do you want to investigate why and open a PR?

di-sukharev avatar May 23 '24 07:05 di-sukharev