Fix antigravity

This commit is contained in:
decolua 2026-02-27 09:17:49 +07:00
parent 9003675b71
commit 9ae5487bc7
3 changed files with 18 additions and 23 deletions

View file

@ -164,8 +164,8 @@ export const PROVIDERS = {
}, },
antigravity: { antigravity: {
baseUrls: [ baseUrls: [
"https://daily-cloudcode-pa.googleapis.com",
"https://cloudcode-pa.googleapis.com", "https://cloudcode-pa.googleapis.com",
"https://daily-cloudcode-pa.googleapis.com"
], ],
format: "antigravity", format: "antigravity",
headers: { headers: {

View file

@ -1,6 +1,6 @@
{ {
"name": "9router-app", "name": "9router-app",
"version": "0.2.98", "version": "0.2.99",
"description": "9Router web dashboard", "description": "9Router web dashboard",
"private": true, "private": true,
"scripts": { "scripts": {

View file

@ -293,32 +293,27 @@ const PROVIDERS = {
console.log("Failed to load code assist:", e); console.log("Failed to load code assist:", e);
} }
// Onboard user to enable Gemini Code Assist // Fire-and-forget onboarding — does not block DB save
if (projectId) { if (projectId) {
try { const doOnboard = async () => {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
const onboardRes = await fetch(ANTIGRAVITY_CONFIG.onboardUserEndpoint, { try {
method: "POST", const onboardRes = await fetch(ANTIGRAVITY_CONFIG.onboardUserEndpoint, {
headers, method: "POST",
body: JSON.stringify({ tierId, metadata, cloudaicompanionProject: projectId, mode: 1 }), headers,
}); body: JSON.stringify({ tierId, metadata, cloudaicompanionProject: projectId, mode: 1 }),
if (onboardRes.ok) { });
const result = await onboardRes.json(); if (onboardRes.ok) {
if (result.done === true) { const result = await onboardRes.json();
// Extract final project ID from response if (result.done === true) break;
if (result.response?.cloudaicompanionProject) {
const respProject = result.response.cloudaicompanionProject;
projectId = typeof respProject === 'string' ? respProject.trim() : (respProject.id || projectId);
}
break;
} }
} catch (e) {
break;
} }
// Wait 5 seconds before retry
await new Promise(resolve => setTimeout(resolve, 5000)); await new Promise(resolve => setTimeout(resolve, 5000));
} }
} catch (e) { };
console.log("Failed to onboard user:", e); doOnboard().catch(() => {});
}
} }
return { userInfo, projectId }; return { userInfo, projectId };