Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ The rules:
- When an ID conflicts from merges, renumber the IDs as needed.
- A change that does not alter how the fork differs from upstream (formatting, or an edit to this file) needs no entry.

### DL066 — Antigravity Gemini gateway configuration

Antigravity provider instances can route Gemini API-key sessions through a configured Gemini-compatible gateway. The provider settings editor exposes the gateway URL, and the server passes it as `GOOGLE_GEMINI_BASE_URL` for the instance's ACP process while keeping ambient gateway values out. Antigravity's existing API key field remains the credential source. OAuth and Agent Platform sessions do not receive the Gemini gateway override because the Antigravity CLI only applies it to Gemini API-key authentication.

**Implementation evidence:** `packages/contracts/src/settings.ts`, `apps/server/src/provider/antigravityAuthSupport.ts`, `apps/server/src/provider/Drivers/AntigravityDriver.ts`, and `apps/web/src/components/settings/{CompatibleApiGatewaySection,ProviderInstanceCard,AddProviderInstanceDialog}.tsx`.

**Recorded validation:** Antigravity environment, contracts, and gateway UI tests, plus the integrated web provider-settings verification for the Antigravity gateway flow.

**Last updated:** 2026-11-24

### DL001 — Provider startup and artifact safeguards

Windows Claude commands are resolved before the Agent SDK starts a session. The resolver follows npm launcher shims to the installed native executable or JavaScript entry point and preserves explicit executable paths. Provider snapshots and DevTools expose sanitized resolver diagnostics; startup provenance identifies installed web artifacts without exposing command output or environment values.
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/provider/Drivers/AntigravityDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const AntigravityDriver: ProviderDriver<
input,
),
auth,
apiGateway: settings.apiGateway,
runtimeTempDirectory,
}),
}).pipe(Effect.provideService(SecureRandom.SecureRandom, random));
Expand Down
37 changes: 37 additions & 0 deletions apps/server/src/provider/antigravityAuthSupport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe("Antigravity process environment", () => {
google_api_key: "case-insensitive-api-key",
GOOGLE_CLOUD_PROJECT: "do-not-use-project",
GOOGLE_CLOUD_LOCATION: "do-not-use-location",
GOOGLE_GEMINI_BASE_URL: "https://ambient-gateway.invalid",
GOOGLE_APPLICATION_CREDENTIALS: "/credentials.json",
GOOGLE_CLOUD_QUOTA_PROJECT: "do-not-use-quota-project",
GOOGLE_GENAI_USE_VERTEXAI: "true",
Expand Down Expand Up @@ -109,6 +110,42 @@ describe("Antigravity process environment", () => {
});
});

it("uses the configured Gemini gateway only for Gemini API-key auth", () => {
const build = (auth: AntigravityAuthConfig) =>
buildAntigravityAcpSpawnInput({
installation: { executablePath: "/release/acp", harnessPath: "/release/harness" },
profile,
cwd: "/project",
baseEnv: { PATH: "/usr/bin", GOOGLE_GEMINI_BASE_URL: "https://ambient.invalid" },
auth,
apiGateway: {
enabled: true,
baseUrl: " https://proxy.example/v1beta ",
useCodexCatalog: false,
codexImageGeneration: false,
catalogFormat: "auto",
authMode: "bearer",
},
}).env ?? {};

expect(
build({
authMethod: "gemini-api-key",
apiKey: "proxy-key",
gcpProject: "",
gcpLocation: "",
}).GOOGLE_GEMINI_BASE_URL,
).toBe("https://proxy.example/v1beta");
expect(
build({
authMethod: "oauth-personal",
apiKey: "",
gcpProject: "",
gcpLocation: "",
}).GOOGLE_GEMINI_BASE_URL,
).toBeUndefined();
});

it("runs the agy CLI as `agy acp` without a harness", () => {
const spawn = buildAntigravityAcpSpawnInput({
installation: { executablePath: "/usr/bin/agy", harnessPath: null },
Expand Down
13 changes: 12 additions & 1 deletion apps/server/src/provider/antigravityAuthSupport.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// @effect-diagnostics-next-line nodeBuiltinImport:off - Effect's symlink has no type argument, and Windows needs a junction to link without elevation.
import * as NodeFSP from "node:fs/promises";

import type { AntigravityAuthMethod, ProviderInstanceId } from "@t3tools/contracts";
import type {
AntigravityAuthMethod,
ApiGatewaySettings,
ProviderInstanceId,
} from "@t3tools/contracts";
import * as HostProcess from "@t3tools/shared/HostProcess";
import { resolveNodeExecutable, nodeRuntimeUnavailableMessage } from "@t3tools/shared/nodeRuntime";
import * as Digest from "effect/crypto/Digest";
Expand Down Expand Up @@ -60,6 +64,7 @@ const browserPreflightUrl = "https://example.invalid/t3-antigravity-browser-pref

const removedEnvironmentKeys = new Set([
"GEMINI_API_KEY",
"GOOGLE_GEMINI_BASE_URL",
"GOOGLE_API_KEY",
"GOOGLE_APPLICATION_CREDENTIALS",
"GOOGLE_CLOUD_PROJECT",
Expand Down Expand Up @@ -197,6 +202,7 @@ function antigravityEnvironment(
profile: AntigravityProfile,
baseEnv: NodeJS.ProcessEnv,
auth: AntigravityAuthConfig,
apiGateway?: ApiGatewaySettings,
runtimeTempDirectory?: string,
) {
const environment: NodeJS.ProcessEnv = {};
Expand All @@ -213,9 +219,12 @@ function antigravityEnvironment(
: {};
// Each launch unpacks about 1 GB; use T3-owned temp so the driver can reclaim files after force-kill.
const tempDirectory = runtimeTempDirectory ?? profile.tempDirectory;
const gatewayUrl =
auth.authMethod === "gemini-api-key" && apiGateway?.enabled ? apiGateway.baseUrl.trim() : "";
return {
...environment,
...credential,
...(gatewayUrl ? { GOOGLE_GEMINI_BASE_URL: gatewayUrl } : {}),
...(profile.caBundlePath !== undefined &&
baseEnv.SSL_CERT_FILE === undefined &&
baseEnv.SSL_CERT_DIR === undefined
Expand Down Expand Up @@ -460,6 +469,7 @@ export function buildAntigravityAcpSpawnInput(input: {
readonly cwd: string;
readonly baseEnv?: NodeJS.ProcessEnv;
readonly auth?: AntigravityAuthConfig;
readonly apiGateway?: ApiGatewaySettings;
readonly runtimeTempDirectory?: string;
}): AcpSessionRuntime.AcpSpawnInput {
return {
Expand All @@ -484,6 +494,7 @@ export function buildAntigravityAcpSpawnInput(input: {
input.profile,
input.baseEnv ?? process.env,
input.auth ?? ANTIGRAVITY_PERSONAL_AUTH,
input.apiGateway,
input.runtimeTempDirectory,
),
...(input.installation.harnessPath === null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ export function AddProviderInstanceDialog({
const driverSettingsFields = deriveProviderSettingsFields(driverOption);
const supportsApiGateway =
driver === ProviderDriverKind.make("codex") ||
driver === ProviderDriverKind.make("claudeAgent");
driver === ProviderDriverKind.make("claudeAgent") ||
driver === ProviderDriverKind.make("antigravity");
const instanceIdError = validateInstanceId(instanceId, existingIds);
const showInstanceIdError = hasAttemptedSubmit && instanceIdError !== null;
const identityStep = 1;
Expand Down Expand Up @@ -739,6 +740,12 @@ export function AddProviderInstanceDialog({
idPrefix={`add-provider-${driver}`}
variant="dialog"
showCodexOptions={driver === ProviderDriverKind.make("codex")}
showApiKey={driver !== ProviderDriverKind.make("antigravity")}
protocol={
driver === ProviderDriverKind.make("antigravity")
? "gemini"
: "openai-anthropic"
}
onChange={setGatewayDraft}
/>
) : null}
Expand Down
Loading
Loading