di-sukharev / di-sukharev/opencommit

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

Open
#347 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.