di-sukharev / di-sukharev/opencommit
[Bug]: 70 seconds delay before proceeding if using `ollama` option with no internet
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 445
- Avg merge
- 18m
- Merged PRs (30d)
- 2
Description
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
- Disable your internet connection
- 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
- Install
ollamaand pullmistralmodel from the library - try to use
ococommand to make a commit
Relevant log output
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided OCO_AI_PROVIDER=ollama configuration, Ollama's mistral model, and networking disabled, then trace the oco command's provider selection and connection timeout. Done means an offline Ollama commit completes without the 70-second delay, with coverage for the disconnected case if the existing test structure supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, ollama
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100