-
Notifications
You must be signed in to change notification settings - Fork 1
feat(models): add support for local Ollama models (#39) #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Resolves issue #37 - Added dual provider support with a new `diffCommit.provider` configuration option - Implemented Ollama integration with model selection and server configuration - Added new commands for Ollama setup and model switching: - `DiffCommit: Configure Ollama Model` - `DiffCommit: Change Ollama Model` - Added new configuration settings: - `diffCommit.ollamaHostname` for server connection - `diffCommit.ollamaModel` for model selection - Updated documentation with Ollama requirements and setup instructions - Enhanced error handling for Ollama-specific scenarios - Updated workflow documentation to include provider selection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends Diff Commit with support for local Ollama models as an alternative to Anthropic, introducing new configuration options, commands, and documentation updates.
- Added
diffCommit.provider,ollamaHostname, andollamaModelsettings with corresponding defaults - Implemented
OllamaManagerand updatedCommitMessageGeneratorto branch on provider - Registered new commands (
Configure Ollama Model,Change Ollama Model) and updated tests and docs
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/configManager.ts | Added provider and Ollama-related fields with defaults |
| src/ollamaManager.ts | New manager for selecting and changing Ollama host/models |
| src/commitMessageGenerator.ts | Extended generator with Ollama branch, prompt builder, and error handling |
| src/extension.ts | Branched commit command on provider and registered new commands |
| package.json | Updated description, dependencies, and configuration schema |
| README.md | Documented Ollama usage, commands, and new config properties |
Comments suppressed due to low confidence (2)
src/commitMessageGenerator.ts:151
- The parameter name 'isIdiotOllamaModel' is unprofessional and unclear. Rename it to something like 'useOllamaFormat' or 'isOllamaProvider' to improve readability and maintainability.
isIdiotOllamaModel: boolean = false,
src/commitMessageGenerator.ts:98
- There are no unit tests verifying the successful path of 'generateOllamaMessage'. Add tests to ensure that a valid Ollama response produces the expected commit message output.
private async generateOllamaMessage(diff: string, config: CommitConfig): Promise<string | undefined> {
Add optional chaining operators to message.usage property access in console log statements to prevent potential "Cannot read property of undefined" errors when the usage object might not exist.
The commit simplifies the status messages displayed when updating Ollama models by: - Removing conditional message logic based on hostname selection - Standardising the success message to always use "updated to" - Simplifying the error message to consistently use "updating" terminology - Removing unnecessary variables that were used for message construction
The commit updates the expected status bar messages in the OllamaManager tests to use more consistent and clear wording. It changes "model 'x' selected successfully" and "model 'x' changed to successfully" to the more precise "model updated to 'x' successfully" format, improving readability and consistency across the test suite.
tsdevau
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-merging PR with corrected title and minor code fixes.
[0.4.0](diff-commit-v0.3.9...diff-commit-v0.4.0) (2025-06-05) ### Features, Additions & Updates * **models:** add support for local Ollama models ([#41](#41)) ([8d0e942](8d0e942)) ### Work in Progress * (rp) revert PR for "Add support for local Ollama models ([#39](#39))" to fix format for RP ([7528a09](7528a09)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
diffCommit.providerconfiguration optionDiffCommit: Configure Ollama ModelDiffCommit: Change Ollama ModeldiffCommit.ollamaHostnamefor server connectiondiffCommit.ollamaModelfor model selectionResolves issue #37