Skip to content

Conversation

@tsdevau
Copy link
Owner

@tsdevau tsdevau commented Jun 5, 2025

  • 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

Resolves issue #37

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
@tsdevau tsdevau self-assigned this Jun 5, 2025
@tsdevau tsdevau requested a review from Copilot June 5, 2025 13:29
@tsdevau tsdevau added the enhancement New feature or request label Jun 5, 2025
Copy link

Copilot AI left a 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, and ollamaModel settings with corresponding defaults
  • Implemented OllamaManager and updated CommitMessageGenerator to 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> {

tsdevau added 3 commits June 5, 2025 23:41
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.
Copy link
Owner Author

@tsdevau tsdevau left a 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.

@tsdevau tsdevau merged commit 8d0e942 into main Jun 5, 2025
3 checks passed
@tsdevau tsdevau deleted the ollama2 branch June 5, 2025 13:48
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants