Skip to content

Commit 8551258

Browse files
committed
fix: resolve Windows crash after review and update Gemini models
Updates the available Gemini models to include the latest Gemini 3.5 series. Introduces 'gemini-3.5-flash' as the new default model. Improves graceful exit handling to prevent potential crashes on Windows. Updates versioning in README and package.json. Closes #1
1 parent 226d908 commit 8551258

3 files changed

Lines changed: 25 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</p>
1111

1212
<p align="center">
13-
<img src="https://img.shields.io/badge/version-2.0.9-blue?style=for-the-badge" alt="Version">
13+
<img src="https://img.shields.io/badge/version-2.1.0-blue?style=for-the-badge" alt="Version">
1414
<img src="https://img.shields.io/badge/Node.js-18%2B-green?style=for-the-badge" alt="Node Version">
1515
<img src="https://img.shields.io/badge/License-ISC-orange?style=for-the-badge" alt="License">
1616
</p>

index.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@ if (typeof inqPrompt !== 'function') {
2424
}
2525

2626
const MODELS = [
27-
{ id: 'gemini-2.5-flash-lite', name: 'Flash-Lite 2.5 (New & Lightest)' },
28-
{ id: 'gemini-2.5-flash', name: 'Flash 2.5 (Fast & Balanced)' },
29-
{ id: 'gemini-3-flash-preview', name: 'Flash 3 (Newest)' },
27+
// Gemini 3.5 Series (Latest Frontier Models)
28+
{ id: 'gemini-3.5-flash', name: 'Gemini 3.5 Flash (Agentic & High-Speed)' },
29+
30+
// Gemini 3.1 Series (Advanced Core Performance)
31+
{ id: 'gemini-3.1-pro-preview', name: 'Gemini 3.1 Pro (Flagship Reasoning - Paid)' },
32+
{ id: 'gemini-3.1-flash-lite', name: 'Gemini 3.1 Flash-Lite (High-Volume Automation)' },
33+
34+
// Gemini 3 Series (Stable Infrastructure)
35+
{ id: 'gemini-3-flash', name: 'Gemini 3 Flash (Fast Modulated Reasoning)' },
36+
{ id: 'gemini-3-pro', name: 'Gemini 3 Pro (Paid Complex Reasoning)' },
37+
38+
// Gemini 2.5 Series (Stable Long-Context)
39+
{ id: 'gemini-2.5-pro', name: 'Gemini 2.5 Pro (Paid Deep Reasoning)' },
40+
{ id: 'gemini-2.5-flash', name: 'Gemini 2.5 Flash (Balanced Price-Performance)' },
41+
{ id: 'gemini-2.5-flash-lite', name: 'Gemini 2.5 Flash-Lite (Low Latency)' },
3042
];
31-
const DEFAULT_MODEL = 'gemini-2.5-flash';
43+
const DEFAULT_MODEL = 'gemini-3.5-flash';
3244

3345
function getModelId() {
3446
return config.get('model_id') ?? DEFAULT_MODEL;
@@ -279,7 +291,7 @@ function getAI() {
279291
const apiKey = config.get('gemini_key');
280292
if (!apiKey) {
281293
console.log(chalk.red("❌ No API Key found! Run 'git-mood setup' first."));
282-
process.exit(1);
294+
cleanupAndExit(1);
283295
}
284296
const genAI = new GoogleGenerativeAI(apiKey);
285297
const modelId = getModelId();
@@ -525,7 +537,7 @@ async function modelCLI() {
525537
program
526538
.name('git-mood')
527539
.description('AI-Powered Git Assistant — conventional commits & code review')
528-
.version('2.0.9');
540+
.version('2.1.0');
529541

530542
program.command('setup').description('Set Gemini API key and model').action(setupCLI);
531543
program.command('model').description('Change Gemini model').action(modelCLI);
@@ -555,14 +567,14 @@ function cleanupAndExit(code) {
555567
// ignore
556568
}
557569
}
558-
process.stdin.pause();
559-
if (typeof process.stdin.unref === 'function') {
560-
process.stdin.unref();
561-
}
562570
} catch {
563571
// ignore
564572
}
565-
process.exit(code);
573+
// Delay the exit slightly to allow libuv handles/threads (e.g., keep-alive fetch connections)
574+
// to clean up and close gracefully, preventing Windows assertion crashes.
575+
setTimeout(() => {
576+
process.exit(code);
577+
}, 100);
566578
}
567579

568580
await program

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-mood",
3-
"version": "2.0.9",
3+
"version": "2.1.0",
44
"description": "AI-powered Git assistant — conventional commits & code review with Gemini",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)