Skip to content

Commit f460692

Browse files
committed
Migrate to @google/genai SDK and fix Gemini API test
- Replace legacy @google/generative-ai with new @google/genai SDK - Add model fallback chain: gemini-3.5-flash -> gemini-3-flash-preview -> gemini-2.5-flash - Fix onboarding API key test checking wrong property (result.success vs result.ok) - Improve 503/high-demand and quota error messages - Fix packaged app icon paths using __dirname - Unpack icons and prompts from asar so they load in packaged builds
1 parent a07a046 commit f460692

7 files changed

Lines changed: 619 additions & 133 deletions

File tree

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ class ApplicationController {
15511551
return { success: false, error: "Invalid icon key" };
15521552
}
15531553

1554-
const fullIconPath = path.resolve(iconPath);
1554+
const fullIconPath = path.resolve(__dirname, iconPath);
15551555

15561556
if (!fs.existsSync(fullIconPath)) {
15571557
logger.error("Icon file not found", {
@@ -1636,7 +1636,7 @@ class ApplicationController {
16361636
// Force dock refresh
16371637
setTimeout(() => {
16381638
app.dock.setIcon(
1639-
require("path").resolve(`assests/icons/${iconKey}.png`)
1639+
require("path").resolve(__dirname, `assests/icons/${iconKey}.png`)
16401640
);
16411641
}, 50);
16421642
}

onboarding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
// saveSettings writes the key into .env (atomic via persistEnvUpdates).
199199
await window.electronAPI.saveSettings({ geminiKey: key });
200200
const result = await window.electronAPI.testGeminiConnection();
201-
if (result && result.ok) {
201+
if (result && result.success) {
202202
state.geminiKey = key;
203203
setKeyStatus('success', `Connected — ${result.model || 'Gemini ready'}`);
204204
} else {

0 commit comments

Comments
 (0)