Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat(aiToolkit): add Gemini 3.7 models to Antigravity provider and migration (#4575)

[._.]/ Adam Eivy8249f611e3ca
diff --git a/data.reference/providers.json b/data.reference/providers.json
index 5c53ff94d9..21e665638d 100644
--- a/data.reference/providers.json
+++ b/data.reference/providers.json
@@ -77,7 +77,7 @@
"type": "cli",
"command": "agy",
"args": ["--print", "--dangerously-skip-permissions"],
- "models": ["antigravity-configured-default","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
+ "models": ["antigravity-configured-default","gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
"defaultModel": "antigravity-configured-default",
"lightModel": "antigravity-configured-default",
"mediumModel": "antigravity-configured-default",
@@ -289,7 +289,7 @@
"type": "tui",
"command": "agy",
"args": ["--dangerously-skip-permissions"],
- "models": ["antigravity-configured-default","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
+ "models": ["antigravity-configured-default","gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
"defaultModel": "antigravity-configured-default",
"lightModel": "antigravity-configured-default",
"mediumModel": "antigravity-configured-default",
diff --git a/scripts/migrations/279-antigravity-gemini-3-7-models.js b/scripts/migrations/279-antigravity-gemini-3-7-models.js
new file mode 100644
index 0000000000..01c507dd8b
--- /dev/null
+++ b/scripts/migrations/279-antigravity-gemini-3-7-models.js
@@ -0,0 +1,94 @@
+/**
+ * Update Antigravity (agy) CLI and TUI model catalog to include Gemini 3.7 models.
+ *
+ * Adds gemini-3.7-flash-high, gemini-3.7-flash-medium, gemini-3.7-flash-low to
+ * the shipped Antigravity model catalog.
+ *
+ * Existing installs whose models list matches the prior seeded catalog or is
+ * sentinel-only are updated to the new catalog. User-customized model lists are
+ * left alone.
+ *
+ * Kept in lockstep with data.reference/providers.json and
+ * server/lib/aiToolkit/defaults/providers.sample.json.
+ */
+
+import { readProvidersDoc, writeJsonAtomic } from './_lib.js';
+
+const PROVIDERS_REL_PATH = 'data/providers.json';
+const TARGET_IDS = ['antigravity-cli', 'antigravity-tui'];
+const SENTINEL = 'antigravity-configured-default';
+
+const OLD_MODELS = [
+ SENTINEL,
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+];
+
+const NEW_MODELS = [
+ SENTINEL,
+ 'gemini-3.7-flash-high',
+ 'gemini-3.7-flash-medium',
+ 'gemini-3.7-flash-low',
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+];
+
+const sameArray = (a, b) =>
+ Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((v, i) => v === b[i]);
+
+export default {
+ async up({ rootDir }) {
+ const doc = await readProvidersDoc({ rootDir });
+ if (!doc.ok) {
+ if (doc.reason === 'no-file') console.log(`📄 ${PROVIDERS_REL_PATH} not present — skipping (fresh install seeds from data.reference with the new defaults)`);
+ else if (doc.reason === 'unreadable') console.log(`⚠️ ${PROVIDERS_REL_PATH}: invalid JSON, skipping (${doc.err.message})`);
+ else console.log(`⚠️ ${PROVIDERS_REL_PATH}: no providers map — skipping`);
+ return;
+ }
+
+ const { config, providers, path: providersPath } = doc;
+ let changed = false;
+
+ for (const id of TARGET_IDS) {
+ if (!Object.hasOwn(providers, id)) continue;
+ const provider = providers[id];
+ if (!provider || typeof provider !== 'object') continue;
+
+ const isSentinelOnly = Array.isArray(provider.models)
+ && provider.models.length === 1
+ && provider.models[0] === SENTINEL;
+
+ if (sameArray(provider.models, OLD_MODELS) || isSentinelOnly) {
+ provider.models = [...NEW_MODELS];
+ changed = true;
+ console.log(`📝 ${PROVIDERS_REL_PATH}: updated ${id} models with Gemini 3.7 catalog`);
+ } else if (sameArray(provider.models, NEW_MODELS)) {
+ console.log(`✅ ${PROVIDERS_REL_PATH}: ${id} already has Gemini 3.7 models`);
+ } else {
+ console.log(`ℹ️ ${PROVIDERS_REL_PATH}: ${id} has custom models list — leaving intact`);
+ }
+ }
+
+ if (changed) {
+ await writeJsonAtomic(providersPath, config);
+ }
+ },
+};
diff --git a/scripts/migrations/279-antigravity-gemini-3-7-models.test.js b/scripts/migrations/279-antigravity-gemini-3-7-models.test.js
new file mode 100644
index 0000000000..7ded535b4f
--- /dev/null
+++ b/scripts/migrations/279-antigravity-gemini-3-7-models.test.js
@@ -0,0 +1,157 @@
+/**
+ * Test for migration 279 — update Antigravity CLI and TUI model catalog to include Gemini 3.7.
+ */
+import { describe, it, expect, beforeEach, afterEach } from 'vitest';
+import { mkdtempSync, rmSync, writeFileSync, readFileSync, mkdirSync } from 'fs';
+import { tmpdir } from 'os';
+import { join } from 'path';
+
+import migration from './279-antigravity-gemini-3-7-models.js';
+
+const writeJson = (path, value) => writeFileSync(path, JSON.stringify(value, null, 2) + '\n');
+const readJson = (path) => JSON.parse(readFileSync(path, 'utf-8'));
+
+const SENTINEL = 'antigravity-configured-default';
+
+const OLD_MODELS = [
+ SENTINEL,
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+];
+
+const NEW_MODELS = [
+ SENTINEL,
+ 'gemini-3.7-flash-high',
+ 'gemini-3.7-flash-medium',
+ 'gemini-3.7-flash-low',
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+];
+
+describe('migration 279 — Antigravity Gemini 3.7 model catalog', () => {
+ let rootDir;
+ let providersPath;
+
+ beforeEach(() => {
+ rootDir = mkdtempSync(join(tmpdir(), 'migration-279-'));
+ mkdirSync(join(rootDir, 'data'), { recursive: true });
+ providersPath = join(rootDir, 'data/providers.json');
+ });
+
+ afterEach(() => {
+ rmSync(rootDir, { recursive: true, force: true });
+ });
+
+ it('updates prior seeded models list on antigravity-cli and antigravity-tui', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'antigravity-cli': {
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: 'agy',
+ models: [...OLD_MODELS],
+ defaultModel: SENTINEL,
+ },
+ 'antigravity-tui': {
+ id: 'antigravity-tui',
+ type: 'tui',
+ command: 'agy',
+ models: [...OLD_MODELS],
+ defaultModel: SENTINEL,
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath);
+ expect(out.providers['antigravity-cli'].models).toEqual(NEW_MODELS);
+ expect(out.providers['antigravity-tui'].models).toEqual(NEW_MODELS);
+ });
+
+ it('updates sentinel-only antigravity providers', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'antigravity-cli': {
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: 'agy',
+ models: [SENTINEL],
+ defaultModel: SENTINEL,
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath);
+ expect(out.providers['antigravity-cli'].models).toEqual(NEW_MODELS);
+ });
+
+ it('leaves already-current model lists alone', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'antigravity-cli': {
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: 'agy',
+ models: [...NEW_MODELS],
+ defaultModel: SENTINEL,
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath);
+ expect(out.providers['antigravity-cli'].models).toEqual(NEW_MODELS);
+ });
+
+ it('leaves customized model lists alone', async () => {
+ const customModels = [SENTINEL, 'my-custom-model', 'gemini-3.6-flash-high'];
+ writeJson(providersPath, {
+ providers: {
+ 'antigravity-cli': {
+ id: 'antigravity-cli',
+ type: 'cli',
+ command: 'agy',
+ models: [...customModels],
+ defaultModel: 'my-custom-model',
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath);
+ expect(out.providers['antigravity-cli'].models).toEqual(customModels);
+ });
+
+ it('is a no-op when data/providers.json does not exist (fresh install)', async () => {
+ rmSync(providersPath, { force: true });
+ await expect(migration.up({ rootDir })).resolves.not.toThrow();
+ });
+
+ it('skips gracefully when providers.json is invalid JSON', async () => {
+ writeFileSync(providersPath, 'not-json');
+ await expect(migration.up({ rootDir })).resolves.not.toThrow();
+ });
+});
diff --git a/scripts/migrations/_lib.js b/scripts/migrations/_lib.js
index 64f59405f9..bd5df1b97b 100644
--- a/scripts/migrations/_lib.js
+++ b/scripts/migrations/_lib.js
@@ -111,7 +111,7 @@ const splitReadJsonTolerant = async (path) => {
// filesystem, and tmp sits in the same dir as its target, so the swap is safe.
// Also used by the provider-seed family, where a truncated `data/providers.json`
// would cost the user every stored apiKey and provider customization.
-const writeJsonAtomic = async (path, value) => {
+export const writeJsonAtomic = async (path, value) => {
const tmp = `${path}.tmp-${process.pid}`;
await writeFile(tmp, JSON.stringify(value, null, 2) + '\n');
await rename(tmp, path);
@@ -772,7 +772,7 @@ const PROVIDERS_REL_PATH = 'data/providers.json';
* while the read shell is shared. `err` carries the parse failure for the
* `'unreadable'` message.
*/
-async function readProvidersDoc({ rootDir }) {
+export async function readProvidersDoc({ rootDir }) {
const path = join(rootDir, PROVIDERS_REL_PATH);
const raw = await readFile(path, 'utf-8').catch((err) => {
if (err.code === 'ENOENT') return null;
diff --git a/server/lib/aiToolkit/defaults/providers.sample.json b/server/lib/aiToolkit/defaults/providers.sample.json
index df8662376f..4be39766f0 100644
--- a/server/lib/aiToolkit/defaults/providers.sample.json
+++ b/server/lib/aiToolkit/defaults/providers.sample.json
@@ -278,7 +278,7 @@
"type": "tui",
"command": "agy",
"args": ["--dangerously-skip-permissions"],
- "models": ["antigravity-configured-default","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
+ "models": ["antigravity-configured-default","gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
"defaultModel": "antigravity-configured-default",
"lightModel": "antigravity-configured-default",
"mediumModel": "antigravity-configured-default",
@@ -296,7 +296,7 @@
"type": "cli",
"command": "agy",
"args": ["--print", "--dangerously-skip-permissions"],
- "models": ["antigravity-configured-default","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
+ "models": ["antigravity-configured-default","gemini-3.7-flash-high","gemini-3.7-flash-medium","gemini-3.7-flash-low","gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3.5-flash-high","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-3.1-pro-high","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium"],
"defaultModel": "antigravity-configured-default",
"lightModel": "antigravity-configured-default",
"mediumModel": "antigravity-configured-default",
diff --git a/server/lib/aiToolkit/providers.js b/server/lib/aiToolkit/providers.js
index e9c896bf40..fa232553a6 100644
--- a/server/lib/aiToolkit/providers.js
+++ b/server/lib/aiToolkit/providers.js
@@ -181,11 +181,14 @@ const CODEX_MODEL_DEFAULTS = {
};
const ANTIGRAVITY_MODEL_KEYS = ['defaultModel', 'lightModel', 'mediumModel', 'heavyModel'];
// agy exposes a per-session `--model` flag and lists its catalog via
-// `agy models`. This is the shipped fallback list (agy 2026-07) used to seed a
+// `agy models`. This is the shipped fallback list (agy 2026-08) used to seed a
// fresh install and when the live `agy models` probe can't run; the AI Providers
// "Refresh models" button replaces it with whatever the installed binary
// reports, which is the authoritative list for that user's plan.
const ANTIGRAVITY_MODELS = [
+ 'gemini-3.7-flash-high',
+ 'gemini-3.7-flash-medium',
+ 'gemini-3.7-flash-low',
'gemini-3.6-flash-high',
'gemini-3.6-flash-medium',
'gemini-3.6-flash-low',
@@ -204,6 +207,23 @@ const ANTIGRAVITY_MODELS = [
// the task/schedule model pickers (which filter the sentinel out) can offer a
// per-run override.
const ANTIGRAVITY_MODEL_CATALOG = [ANTIGRAVITY_CONFIGURED_DEFAULT, ...ANTIGRAVITY_MODELS];
+const PRIOR_ANTIGRAVITY_MODEL_CATALOGS = [
+ // Prior 2026-07 catalog without gemini-3.7
+ [
+ ANTIGRAVITY_CONFIGURED_DEFAULT,
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+ ],
+];
const CODEX_CONTEXT_WINDOW = 1_000_000;
const GEMINI_CONTEXT_WINDOW = 1_048_576;
const STALE_GENERIC_CONTEXT_WINDOW = 128_000;
@@ -325,12 +345,12 @@ function migrateAntigravityProviders(data) {
return changed;
}
-// Installs that already migrated to `agy` carry the sentinel-only model list
-// from before agy grew a `--model` flag. Widen it to the shipped catalog so the
-// task/schedule pickers have something to offer. Guarded on "sentinel-only" so a
-// user's own list (or one already refreshed from `agy models`) is never
-// overwritten, and the `*Model` keys are left alone so run behavior is unchanged
-// until the user actually picks a model.
+// Installs that carry the sentinel-only model list from before agy grew a
+// `--model` flag, or the prior shipped catalog before gemini-3.7 was released,
+// are widened/updated to the current shipped catalog so pickers have the new
+// model options. Guarded so a user's own customized list (or one already
+// refreshed from `agy models`) is never overwritten, and the `*Model` keys are
+// left alone so run behavior is unchanged until the user actually picks a model.
function migrateAntigravityModelCatalog(data) {
if (!data?.providers) return false;
let changed = false;
@@ -342,7 +362,13 @@ function migrateAntigravityModelCatalog(data) {
const isSentinelOnly = Array.isArray(provider.models)
&& provider.models.length === 1
&& provider.models[0] === ANTIGRAVITY_CONFIGURED_DEFAULT;
- if (!isSentinelOnly) continue;
+
+ const isPriorSeededList = Array.isArray(provider.models)
+ && PRIOR_ANTIGRAVITY_MODEL_CATALOGS.some(
+ (prior) => prior.length === provider.models.length && prior.every((m, i) => m === provider.models[i]),
+ );
+
+ if (!isSentinelOnly && !isPriorSeededList) continue;
provider.models = [...ANTIGRAVITY_MODEL_CATALOG];
changed = true;
diff --git a/server/lib/aiToolkit/providers.test.js b/server/lib/aiToolkit/providers.test.js
index 363b9bcbbf..84b842ebbe 100644
--- a/server/lib/aiToolkit/providers.test.js
+++ b/server/lib/aiToolkit/providers.test.js
@@ -595,6 +595,7 @@ describe('Provider Service', () => {
const antigravity = await providerService.getProviderById('antigravity-cli');
expect(antigravity.models.length).toBeGreaterThan(1);
expect(antigravity.models[0]).toBe('antigravity-configured-default');
+ expect(antigravity.models).toContain('gemini-3.7-flash-high');
expect(antigravity.models).toContain('claude-sonnet-4-6');
// The *Model keys are untouched: an install that never picks a model keeps
// agy's own configured default (no --model flag), exactly as before.
@@ -602,6 +603,45 @@ describe('Provider Service', () => {
expect(antigravity.lightModel).toBe('antigravity-configured-default');
});
+ it('upgrades a prior-seeded Antigravity model list to include Gemini 3.7 models', async () => {
+ const priorModels = [
+ 'antigravity-configured-default',
+ 'gemini-3.6-flash-high',
+ 'gemini-3.6-flash-medium',
+ 'gemini-3.6-flash-low',
+ 'gemini-3.5-flash-high',
+ 'gemini-3.5-flash-medium',
+ 'gemini-3.5-flash-low',
+ 'gemini-3.1-pro-high',
+ 'gemini-3.1-pro-low',
+ 'claude-sonnet-4-6',
+ 'claude-opus-4-6-thinking',
+ 'gpt-oss-120b-medium',
+ ];
+ await writeProvidersFile({
+ activeProvider: 'antigravity-cli',
+ providers: {
+ 'antigravity-cli': {
+ id: 'antigravity-cli',
+ name: 'Antigravity CLI',
+ type: 'cli',
+ command: 'agy',
+ contextWindow: 1048576,
+ models: [...priorModels],
+ defaultModel: 'antigravity-configured-default',
+ lightModel: 'antigravity-configured-default'
+ }
+ }
+ });
+
+ const antigravity = await providerService.getProviderById('antigravity-cli');
+ expect(antigravity.models).toContain('gemini-3.7-flash-high');
+ expect(antigravity.models).toContain('gemini-3.7-flash-medium');
+ expect(antigravity.models).toContain('gemini-3.7-flash-low');
+ expect(antigravity.models).toContain('gemini-3.6-flash-high');
+ expect(antigravity.defaultModel).toBe('antigravity-configured-default');
+ });
+
// A failed `agy models` probe must be distinguishable from a real fetch.
// Returning the shipped catalog here would persist it and toast "Models
// refreshed", so a user whose service PATH can't resolve `agy` would pick a