opencode-studio-server 1.12.11 → 1.12.13
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/index.js +17 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -291,8 +291,8 @@ function loadStudioConfig() {
|
|
|
291
291
|
availableGooglePlugins: [],
|
|
292
292
|
presets: [],
|
|
293
293
|
cooldownRules: [
|
|
294
|
-
{ name: "Opus
|
|
295
|
-
{ name: "Gemini 3 Pro (
|
|
294
|
+
{ name: "Antigravity Claude Opus (4h)", duration: 4 * 60 * 60 * 1000 },
|
|
295
|
+
{ name: "Antigravity Gemini 3 Pro (24h)", duration: 24 * 60 * 60 * 1000 }
|
|
296
296
|
],
|
|
297
297
|
pluginModels: {
|
|
298
298
|
gemini: {
|
|
@@ -427,7 +427,18 @@ function loadStudioConfig() {
|
|
|
427
427
|
if (!fs.existsSync(STUDIO_CONFIG_PATH)) return defaultConfig;
|
|
428
428
|
try {
|
|
429
429
|
const config = JSON.parse(fs.readFileSync(STUDIO_CONFIG_PATH, 'utf8'));
|
|
430
|
-
|
|
430
|
+
const merged = { ...defaultConfig, ...config };
|
|
431
|
+
|
|
432
|
+
if (config.cooldownRules) {
|
|
433
|
+
defaultConfig.cooldownRules.forEach(defaultRule => {
|
|
434
|
+
const existing = config.cooldownRules.find(r => r.name === defaultRule.name);
|
|
435
|
+
if (!existing) {
|
|
436
|
+
merged.cooldownRules.push(defaultRule);
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return merged;
|
|
431
442
|
} catch {
|
|
432
443
|
return defaultConfig;
|
|
433
444
|
}
|
|
@@ -1711,23 +1722,9 @@ app.put('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
|
1711
1722
|
});
|
|
1712
1723
|
|
|
1713
1724
|
app.post('/api/auth/login', (req, res) => {
|
|
1714
|
-
let
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
const ALLOWED_PROVIDERS = [
|
|
1718
|
-
"", "google", "anthropic", "openai", "xai",
|
|
1719
|
-
"openrouter", "github-copilot", "gemini",
|
|
1720
|
-
"together", "mistral", "deepseek", "amazon-bedrock", "azure"
|
|
1721
|
-
];
|
|
1722
|
-
|
|
1723
|
-
if (provider && !ALLOWED_PROVIDERS.includes(provider)) {
|
|
1724
|
-
return res.status(400).json({ error: 'Invalid provider' });
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
if (typeof provider !== 'string') provider = "";
|
|
1728
|
-
|
|
1729
|
-
let cmd = 'opencode auth login';
|
|
1730
|
-
if (provider) cmd += ` ${provider}`;
|
|
1725
|
+
// Always run generic `opencode auth login` - let CLI handle provider selection
|
|
1726
|
+
// This avoids bugs in CLI where specific providers (e.g. openai) fail with "fetch() URL is invalid"
|
|
1727
|
+
const cmd = 'opencode auth login';
|
|
1731
1728
|
|
|
1732
1729
|
const cp = getConfigPath();
|
|
1733
1730
|
const configDir = cp ? path.dirname(cp) : process.cwd();
|