@lay111/dsh-plugin-google 1.0.14 → 1.0.15
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/package.json +1 -1
- package/src/api.js +1 -5
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -3,7 +3,7 @@ import { findModel } from './models.js';
|
|
|
3
3
|
|
|
4
4
|
const ANTIGRAVITY_ENDPOINTS = [
|
|
5
5
|
'https://daily-cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',
|
|
6
|
-
'https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse',
|
|
6
|
+
'https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse',
|
|
7
7
|
];
|
|
8
8
|
|
|
9
9
|
export function formatMessagesToAntigravity(messages, modelSpec, projectId) {
|
|
@@ -143,7 +143,6 @@ export async function* streamAntigravity(options, accessToken, projectId) {
|
|
|
143
143
|
const errText = await res.text();
|
|
144
144
|
lastError = `(HTTP ${status}) ${errText}`;
|
|
145
145
|
|
|
146
|
-
// If rate-limited (429) or temporary server overload (503), wait and retry
|
|
147
146
|
if ((status === 429 || status === 503) && attempt < maxRetries - 1) {
|
|
148
147
|
await new Promise((r) => setTimeout(r, (attempt + 1) * 1500));
|
|
149
148
|
continue;
|
|
@@ -160,9 +159,6 @@ export async function* streamAntigravity(options, accessToken, projectId) {
|
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
if (!response) {
|
|
163
|
-
if (lastError?.includes('429') || lastError?.includes('exhausted')) {
|
|
164
|
-
throw new Error(`Google Quota Exceeded (429): 当前模型并发或配额超限。建议在 TUI 中输入 /model 切换至 claude-sonnet-4.6、gemini-3.7-flash-medium 或 gemini-3.6-flash,或稍等 20 秒后重试。`);
|
|
165
|
-
}
|
|
166
162
|
throw new Error(`Google Antigravity Upstream Error: ${lastError}`);
|
|
167
163
|
}
|
|
168
164
|
|