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.
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
commented
Jun 5, 2025
Owner
Author
tsdevau
left a comment
There was a problem hiding this comment.
Re-merging PR with corrected title and minor code fixes.
tsdevau
pushed a commit
that referenced
this pull request
Jun 5, 2025
[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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
diffCommit.providerconfiguration optionDiffCommit: Configure Ollama ModelDiffCommit: Change Ollama ModeldiffCommit.ollamaHostnamefor server connectiondiffCommit.ollamaModelfor model selectionResolves issue #37