coder-agent 2.9.0 → 2.9.1
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.
- package/dist/config.js +2 -2
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -59,7 +59,7 @@ export async function getStoredApiKey() {
|
|
|
59
59
|
}
|
|
60
60
|
export async function saveApiKey(apiKey) {
|
|
61
61
|
const config = await readConfig();
|
|
62
|
-
config.geminiApiKey = apiKey;
|
|
62
|
+
config.geminiApiKey = apiKey.trim();
|
|
63
63
|
await writeConfig(config);
|
|
64
64
|
}
|
|
65
65
|
export async function getStoredModel() {
|
|
@@ -77,7 +77,7 @@ export async function getStoredGeminiApiKey() {
|
|
|
77
77
|
}
|
|
78
78
|
export async function saveGeminiApiKey(geminiApiKey) {
|
|
79
79
|
const config = await readConfig();
|
|
80
|
-
config.geminiApiKey = geminiApiKey;
|
|
80
|
+
config.geminiApiKey = geminiApiKey.trim();
|
|
81
81
|
await writeConfig(config);
|
|
82
82
|
}
|
|
83
83
|
export async function getLastUsedInfo() {
|
package/dist/index.js
CHANGED
|
@@ -162,7 +162,10 @@ async function main() {
|
|
|
162
162
|
// Load stored settings
|
|
163
163
|
const storedKey = await getStoredApiKey();
|
|
164
164
|
const envKey = process.env.GEMINI_API_KEY || process.env.GROQ_API_KEY;
|
|
165
|
-
let apiKey = envKey || storedKey;
|
|
165
|
+
let apiKey = (envKey || storedKey || "").trim();
|
|
166
|
+
if ((apiKey.startsWith('"') && apiKey.endsWith('"')) || (apiKey.startsWith("'") && apiKey.endsWith("'"))) {
|
|
167
|
+
apiKey = apiKey.slice(1, -1).trim();
|
|
168
|
+
}
|
|
166
169
|
const storedModel = await getStoredModel();
|
|
167
170
|
let defaultModel = "gemini-2.5-flash";
|
|
168
171
|
if (storedModel && VALID_MODELS.includes(storedModel)) {
|