di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.97k stars 318 forks source link

[Bug]: Local Ollama with OpenCommit not working when internet is blocked #311

Open recrack opened 6 months ago

recrack commented 6 months ago

Opencommit Version

v1.0.2

Node Version

v20.5.1

NPM Version

9.8.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

I am trying to use local Ollama for my project, but I have encountered an issue where OpenCommit does not work when the internet is disconnected.

Expected Behavior

When using local Ollama, OpenCommit should continue to function properly even if the internet is disconnected.

Current Behavior

OpenCommit does not work when the internet is disconnected while using local Ollama. This causes issues with committing changes to the local repository and can lead to lost or untracked changes.

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

di-sukharev commented 6 months ago

@jaroslaw-weber hello again :) any idea why this happens with ollama?

jaroslaw-weber commented 6 months ago

Not sure, probably something related to running ollama in local server? We basically do a API call to localhost so maybe related.

di-sukharev commented 6 months ago

look like a request can not be made with no internet, lets see if this happens again, keeping the issue opened

recrack commented 6 months ago

@di-sukharev @jaroslaw-weber

my .opencommit

OCO_OPENAI_API_KEY=undefined
OCO_TOKENS_MAX_INPUT=undefined
OCO_TOKENS_MAX_OUTPUT=undefined
OCO_OPENAI_BASE_PATH=undefined
OCO_DESCRIPTION=undefined
OCO_EMOJI=undefined
OCO_MODEL=undefined
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_AI_PROVIDER=ollama
hacker-hackman commented 4 months ago

@di-sukharev actually opencommit is working but with a delay I described in #347