jeeves-git-commit 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c872a93b165676929a52e68bde2ec00eeb33117a0307f63d2a2ad61913a8ba5
4
- data.tar.gz: 57a1e4553c635cb3d7dd85e261ee819a80e11eeba89aa6888d0c6ba8070f17da
3
+ metadata.gz: 6f9cafa5a9ee72892de5d30d61a265d6aafe57a992c2be8ca86619a9db35a9ee
4
+ data.tar.gz: 6cc58003d2999ee7c5346782fab3ffd2d74857da5752f99a72653876b83c27a5
5
5
  SHA512:
6
- metadata.gz: c8954926ae9d9119eea5d1ac54fd8d5c7694c6e8fd038ee5f34c5468ad72f0e6566f42ec3f80f4f0903b6e61b3723af85604def5bf29c596daaaec038be801f0
7
- data.tar.gz: 071ac9b3e481c645de211cf0e083b322f6bd6642992706618e4ff2b7c9d04f39c404c94d992a0d939c7d7d71a190d84ab1b8fa6dee24d58324205a87c103279d
6
+ metadata.gz: feb83d49fee7a876c25260eb8f9d34538f9022266b5f866f3edcd625f6c3cf10453284b4e059b405377bf860baba5d6ef7fe0590b0e3e40314c0c256b253aff5
7
+ data.tar.gz: bd432c77c41aa452ab0699e87444fa310c34ffbcf5663f78332933218706ad2f79fc388dd6e973c69204129d0c34e7a1ac1cd129babfceb606d92297ba928a06
data/README.md CHANGED
@@ -9,10 +9,10 @@ Jeeves is a command-line tool that creates AI-powered Git commit messages that m
9
9
  ## Features
10
10
 
11
11
  - Generate intelligent [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) messages with [gitmoji](https://gitmoji.dev) based on your staged changes that point out what an idiot you are.
12
- - Option to automatically stage all changes before committing
13
- - Option to push changes after committing
14
- - Customizable AI prompts for tailored commit message generation
15
- - Choose any AI model (chat-gpt 5-mini by default)
12
+ - Option to automatically stage all changes before committing.
13
+ - Option to push changes after committing.
14
+ - Customizable AI prompts for tailored commit message generation.
15
+ - Choose any AI model (chat-gpt 5-mini by default).
16
16
 
17
17
  ## Example Commit message
18
18
 
@@ -115,10 +115,10 @@ You can get an API key from [OpenRouter](https://openrouter.ai/).
115
115
  Optionally, you can specify a different model by setting:
116
116
 
117
117
  ```bash
118
- export GIT_COMMIT_MODEL="openai/gpt-5-chat"
118
+ export GIT_COMMIT_MODEL="openai/gpt-4o"
119
119
  ```
120
120
 
121
- The default model is `openai/gpt-5-mini` if not specified.
121
+ The default model is `openai/gpt-4o-mini` if not specified.
122
122
 
123
123
  ### Prompt Configuration
124
124
 
data/config/prompt CHANGED
@@ -1,21 +1,20 @@
1
- Generate a git commit message based on the following diff.
1
+ You are a git commit message generator. Your job is to write a commit message for the following git diff.
2
2
 
3
- IMPORTANT: Respond ONLY with the final commit message. Do not include any reasoning, thinking, or explanation about how you created the message.
3
+ OUTPUT ONLY THE COMMIT MESSAGE - NO EXPLANATIONS, NO REASONING, NO COMMENTARY.
4
4
 
5
- The commit message should:
6
- - Start with an appropriate gitmoji based on the nature of the changes
7
- - Follow the Conventional Commits format (https://www.conventionalcommits.org/en/v1.0.0/)
8
- - Explain WHAT changed and WHY it changed
9
- - Use present tense ("add" not "added")
10
- - Be extremely critical and mercilessly roast the author of the change
11
- - Assume the audience is educated software engineers
5
+ Rules for the commit message:
6
+ - Start with a gitmoji emoji
7
+ - Follow conventional commit format: type(scope): description
8
+ - Be brutally honest and roast the code author
9
+ - Use present tense verbs
10
+ - Include a detailed body explaining the changes
12
11
 
13
- Example format:
14
- :emoji: type(scope): concise description
12
+ Example:
13
+ feat(api): add error handling because apparently nobody thought about what happens when things go wrong
15
14
 
16
- Detailed explanation of the changes, why they were necessary, and their impact.
17
-
18
- Additional context or technical details when relevant.
15
+ Implement basic error handling for the authentication endpoint because someone decided to ship code that crashes spectacularly when the database is unreachable. Add try-catch blocks, proper error responses, and logging so we can at least pretend to be professional developers.
19
16
 
20
17
  DIFF:
21
18
  {{DIFF}}
19
+
20
+ COMMIT MESSAGE:
@@ -1,3 +1,3 @@
1
1
  module Jeeves
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
data/lib/jeeves.rb CHANGED
@@ -120,7 +120,7 @@ module Jeeves
120
120
  exit 1
121
121
  end
122
122
 
123
- model = ENV['GIT_COMMIT_MODEL'] || 'openai/gpt-5-mini'
123
+ model = ENV['GIT_COMMIT_MODEL'] || 'openai/gpt-4o-mini'
124
124
 
125
125
  prompt_file_path = get_prompt_file_path
126
126
  puts "Using prompt file: #{prompt_file_path}"
@@ -150,13 +150,12 @@ module Jeeves
150
150
  request_body = {
151
151
  model: model,
152
152
  messages: messages,
153
- max_tokens: 500
153
+ max_tokens: 1000,
154
+ stop: ["END_COMMIT"]
154
155
  }
155
156
 
156
- # For reasoning models, try to exclude reasoning from output
157
- if model.include?('gpt-5') || model.include?('o1')
158
- request_body[:reasoning] = { exclude: true }
159
- end
157
+ # Remove any reasoning parameters that cause API errors
158
+ # GPT-5 mini will put reasoning in the reasoning field regardless
160
159
 
161
160
  request.body = request_body.to_json
162
161
 
@@ -171,12 +170,6 @@ module Jeeves
171
170
  message = result['choices'][0]['message']
172
171
  commit_message = message['content']
173
172
 
174
- # Handle OpenAI reasoning models (like GPT-5 mini) where content might be empty
175
- # but reasoning contains the actual response
176
- if (!commit_message || commit_message.strip.empty?) && message['reasoning']
177
- commit_message = message['reasoning']
178
- end
179
-
180
173
  if commit_message && !commit_message.strip.empty?
181
174
  commit_message = commit_message.strip
182
175
  puts "Generated commit message:"
@@ -186,7 +179,8 @@ module Jeeves
186
179
  return commit_message
187
180
  else
188
181
  puts "Error: API returned empty commit message"
189
- puts "Full API response: #{response.body}"
182
+ puts "This model (#{model}) may not be compatible with direct output."
183
+ puts "Try using a different model with: export GIT_COMMIT_MODEL=\"openai/gpt-4o-mini\""
190
184
  exit 1
191
185
  end
192
186
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeeves-git-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bishop