Skip to content

Sparkle Icon Commit Message Generator Uses Different Customization Path Than Command #4105

@petekp

Description

@petekp

Description

There appears to be an inconsistency between the sparkle icon commit message generator and the command-based generator. Both features generate commit messages using AI, but they seem to use different code paths which causes them to behave differently despite having the same configuration settings.

Current Behavior

When I use the GitLens command (GitLens: Generate Commit Message), it correctly uses my customized Claude 3.5 Sonnet model and follows my custom instructions.

When I use the sparkle icon in the commit message input box, it appears to use a different model or ignores my custom instructions, producing different commit message formats.

Expected Behavior

Both methods should respect the same configuration settings and produce consistent results, regardless of which entry point I use to generate a commit message.

Technical Details

After examining the GitLens source code, I found that:

  • The sparkle icon uses AICommitMessageProvider.provideCommitMessage() with { source: 'scm-input' } parameter
  • The command uses GenerateCommitMessageCommand.execute() with { source: 'commandPalette' } parameter
  • While both ultimately call the same this.container.ai.generateCommitMessage() function, they appear to apply customizations differently.

Configuration

I've already configured the following settings:

"gitlens.ai.generateCommitMessage.customInstructions": "You must write in imperative mood...",
"gitlens.ai.model": "anthropic:claude-3-5-sonnet-latest",
"gitlens.ai.vscode.model": "anthropic:claude-3-5-sonnet-latest",
"gitlens.ai.generateCommitMessage.enabled": true

I've also tried resetting all GitLens data and various other AI-related settings, but the sparkle icon behavior remains inconsistent with the command behavior.

Additional Information

I initially assumed this was a configuration issue, but after reviewing the code, it appears to be related to how the two different code paths handle customization. The issue is that users would expect consistent behavior regardless of which entry point they use to generate a commit message.

GitLens Version

16.3.2

VS Code Version

Cursor IDE Version: 0.46.3
VSCode Version: 1.96.2
Commit: fce3511bab261b4c986797f3e1e40e7621bbd010
Date: 2025-02-24T11:21:00.260Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.3.0

Git Version

git version 2.48.1

Logs, Screenshots, Screen Captures, etc

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-aiIssues or features related to AInot-bugEither not a bug or not related to the project

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions