@devries-cameron20 / t3code Mirror · read-only / commits / 46b626263f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

fix(server): token analytics record new Antigravity models (#39897)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Nov 20, 2026 at 13:25 UTC 46b626263fcfaa13d09448272dd749c82c95023a
2 files changed +23 -4
apps/server/src/telemetry/ProviderDimensions.ts
+9 -4
@@ -44,7 +44,8 @@ export function providerDimensions(
44 const DATED_SNAPSHOT = /-\d{8}$/u;
45
46 // The bundled manifest is reviewed in this repo. Codex lists whatever its configured
47 -// model provider serves, so only the manifest vouches for Codex, Claude, and Antigravity.
47 +// model provider serves, so only the manifest vouches for Codex and Claude. Cursor, Grok,
48 +// and Antigravity list their vendor's catalog, which ships models before the manifest does.
49 const MANIFEST_LABELS: ReadonlyMap<string, string> = new Map(
50 Object.values(BUNDLED_MODEL_MANIFEST.providers ?? {}).flatMap((catalog) =>
51 catalog.models.flatMap((model) =>
@@ -52,12 +53,13 @@ const MANIFEST_LABELS: ReadonlyMap<string, string> = new Map(
53 ),
54 ),
55 );
55 -const REGISTRY_LABEL_DRIVERS: ReadonlySet<string> = new Set(["cursor", "grok"]);
56 +const REGISTRY_LABEL_DRIVERS: ReadonlySet<string> = new Set(["cursor", "grok", "antigravity"]);
57
58 /**
59 * The vendor catalog slug that a native or routed model id names, such as
60 * `anthropic/claude-opus-5-5` or a dated snapshot. Models outside the bundled
60 - * manifest and the Cursor and Grok catalogs, including user-added ones, return undefined.
61 + * manifest and the Cursor, Grok, and Antigravity catalogs, including user-added ones,
62 + * return undefined.
63 */
64 export function catalogModelLabel(
65 providers: ReadonlyArray<ServerProvider>,
@@ -72,7 +74,10 @@ export function catalogModelLabel(
74 for (const provider of providers) {
75 if (!REGISTRY_LABEL_DRIVERS.has(provider.driver)) continue;
76 const match = provider.models.find(
75 - (entry) => !entry.isCustom && candidates.includes(entry.slug),
77 + (entry) =>
78 + !entry.isCustom &&
79 + (candidates.includes(entry.slug) ||
80 + entry.aliases?.some((alias) => candidates.includes(alias)) === true),
81 );
82 if (match !== undefined) return match.slug;
83 }
apps/server/src/telemetry/ProviderUsageAnalytics.test.ts
+14
@@ -30,6 +30,14 @@ const providers = [
30 { driver: "codex", models: [{ slug: "gpt-6-sol" }, { slug: "acme-azure-deployment" }] },
31 { driver: "claudeAgent", models: [{ slug: "claude-opus-5-5" }, { slug: "claude-haiku-4-5" }] },
32 { driver: "opencode", models: [{ slug: "ollama/acme-internal" }] },
33 + // Antigravity ships models before the bundled manifest lists them.
34 + {
35 + driver: "antigravity",
36 + models: [
37 + { slug: "gemini-4-neon", aliases: ["antigravity-default"] },
38 + { slug: "gemini-4-hydrogen" },
39 + ],
40 + },
41 ].map(
42 ({ driver, models }) =>
43 ({
@@ -325,6 +333,12 @@ describe("provider usage reporting", () => {
333 expect(routed("ollama/acme-internal", "secret-variant")).not.toHaveProperty("effort");
334 });
335
336 + it("reports Antigravity catalog models the bundled manifest does not list", () => {
337 + expect(label("gemini-4-hydrogen")).toBe("gemini-4-hydrogen");
338 + expect(label("antigravity-default")).toBe("gemini-4-neon");
339 + expect(label("gemini-4-unlisted")).toBeUndefined();
340 + });
341 +
342 it("reports closed service tiers from a tier option or a fast mode toggle", () => {
343 const tier = (option: { id: string; value: string | boolean }) =>
344 providerTurnProperties(