From 07d444a717026afb5b6205880accf4e4bfc9cb80 Mon Sep 17 00:00:00 2001
From: Dotta <34892728+cryppadotta@users.noreply.github.com>
Date: Wed, 25 Nov 2026 07:03:49 -0600
Subject: [PATCH] feat(plugins): carry a Gemini API key to plugin Runners for
Google Antigravity (#22930)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Plugin environments (for example, an agent computer) run agents as
plugin Runner tasks. Core sends each task one typed credential.
> - The typed `provider-env` credential carries API keys for Grok,
Copilot and OpenCode. It has no entry for Google Antigravity.
> - So an Antigravity agent cannot get its Gemini API key on a plugin
Runner task. This is gap G3 and work item 1 in the Antigravity Cloud
rollout plan (#22923).
> - This pull request adds `antigravity` to `provider-env`, with the
single variable set `GEMINI_API_KEY`. It follows the Copilot pattern
from #22359.
> - The benefit is that a plugin (for example, the Paperclip Cloud agent
computer) can now accept a Gemini API key for an Antigravity task.
Google sign-in, the plugin-target refusal and the qualification flip
stay out of scope.
## Linked Issues or Issue Description
Refs #22923
Refs #22359
**What problem does this solve?**
A plugin Runner task cannot carry a Gemini API key. `provider-env`
accepts only `grok`, `copilot` and `opencode`, and Core throws "Plugin
Runner does not support the selected credential provider" for
Antigravity.
**Proposed solution**
Add `antigravity: [["GEMINI_API_KEY"]]` to the published key sets and to
the `provider-env` provider enum. Core transfers only that key. Core
refuses a Google sign-in or a missing key with a plain message.
**Alternatives considered**
A new credential type only for Gemini. The generic `provider-env` type
already has the exact-set check, the binding contract and the
cross-check against the Runner's allowlists, so a new type adds no
value.
## What Changed
- `packages/plugins/sdk/src/environment-tasks.ts`:
`ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS` has `antigravity:
[["GEMINI_API_KEY"]]`. The `provider-env` provider enum accepts
`antigravity`. Mixed, partial and extra variable sets stay rejected.
- `server/src/services/native-runtime/plugin-runner-credentials.ts`: for
provider `antigravity`, Core sends only `GEMINI_API_KEY`. Core refuses a
Google sign-in document (`PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET`)
or a missing or blank key with "Plugin Runner supports Google
Antigravity only with a Gemini API key. Google sign-in is not
supported." No key value is in any error message.
- Tests: SDK schema cases (accept the key; reject a sign-in document, a
key mixed with a sign-in document, `GOOGLE_API_KEY`, extra routing
variables, empty values, and the key under another provider). Core
transfer and refusal cases. Dispatch only for the matching `antigravity`
harness, with no key in persisted lease metadata or in a worker error. A
Runner check that the Antigravity process gets the key and no `GOOGLE_*`
or other `GEMINI_*` variable.
- Docs: `doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md` and
`doc/plugins/PLUGIN_RUNNER_EXECUTION.md` list the new set, the binding
requirement and the sign-in refusal.
- `tests/runner-e2e/source-sdk-public-inputs.json`: refreshed for the
changed SDK source.
## Verification
- Red first: the new tests failed before the change (the schema rejected
`antigravity`, and Core threw "does not support the selected credential
provider").
- Green after the change:
- `cd packages/plugins/sdk && npx vitest run tests/` (322 passed)
- `cd server && npx vitest run
src/__tests__/plugin-runner-credential-names.test.ts
src/services/native-runtime/plugin-runner-credentials.test.ts
src/__tests__/environment-task-runtime.test.ts` (94 passed)
- `cd packages/plugins/sdk && npx tsc --noEmit -p .` and `cd server &&
npx tsc --noEmit -p .` (clean)
- `node tests/runner-e2e/source-sdk-public-inputs.mjs
--check`
(no change)
- `pnpm verify` asks for broad CI coverage (exit 2) because an SDK test
file changed. Required CI supplies that coverage.
- No live run. Antigravity on a plugin target stays refused by Core
until a later change lifts that refusal, so this change is not reachable
in a run yet.
## Risks
- Low risk. The change adds one enum value and one key set. Existing
providers keep the same behavior.
- Plugins that validate with an older SDK reject an `antigravity`
credential. This is the expected fail-closed result.
- The key reaches the Runner only through the typed credential. The
Runner still requires a matching `PAPERCLIP_ACPX_CREDENTIAL_BINDING` and
still removes other `GOOGLE_*` and `GEMINI_*` variables.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits) and extended thinking.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5
---
doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md | 18 +++++++----
doc/plugins/PLUGIN_RUNNER_EXECUTION.md | 6 ++--
packages/plugins/sdk/src/environment-tasks.ts | 4 ++-
.../environment-task-release-resume.test.ts | 11 +++++++
.../environment-task-runtime.test.ts | 12 ++++++--
.../plugin-runner-credential-names.test.ts | 18 +++++++++++
.../plugin-runner-credentials.test.ts | 30 +++++++++++++++++++
.../plugin-runner-credentials.ts | 7 ++++-
.../runner-e2e/source-sdk-public-inputs.json | 2 +-
9 files changed, 94 insertions(+), 14 deletions(-)
diff --git a/doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md b/doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md
index 79907dd0aa8..69d7cdd7879 100644
--- a/doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md
+++ b/doc/plugins/PLUGIN_ENVIRONMENT_TASKS.md
@@ -77,7 +77,7 @@ The `credential` field has one of these types:
| --- | --- | --- |
| `codex-auth-json` | `authJson`: the selected Codex `auth.json` | `codex` |
| `claude-env` | `environment`: exactly one of `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY` | `claude` |
-| `provider-env` | `provider` and `environment`: one complete variable set for that provider | `grok`, `copilot` or `opencode` |
+| `provider-env` | `provider` and `environment`: one complete variable set for that provider | `grok`, `copilot`, `opencode` or `antigravity` |
A `provider-env` credential contains exactly one of these variable sets and no
other variable:
@@ -87,6 +87,7 @@ other variable:
| `grok` | `XAI_API_KEY` |
| `copilot` | `COPILOT_GITHUB_TOKEN` |
| `opencode` | `OPENROUTER_API_KEY`, or `PAPERCLIP_AI_PROVIDER_URL` with `PAPERCLIP_AI_PROVIDER_KEY` |
+| `antigravity` | `GEMINI_API_KEY` |
`ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS` exports this list. A server test
checks every set against the names that the Runner forwards to each provider. Every value
@@ -94,17 +95,22 @@ is non-empty and contains no NUL byte. The `provider` always matches the
Runner harness of the task. Set the variables in the environment of the Runner
process. The Runner gives each variable only to its provider.
-For `copilot`, also set `PAPERCLIP_ACPX_CREDENTIAL_BINDING` in the Runner
-environment. Its value is this JSON object, with the normalized session ID of
-the task's PRP identity:
+For `copilot` and `antigravity`, also set `PAPERCLIP_ACPX_CREDENTIAL_BINDING`
+in the Runner environment. Its value is this JSON object, with the provider as
+`agent`, its variable names as `names`, and the normalized session ID of the
+task's PRP identity:
```json
{"schema":"paperclip.acpx_credential_binding.v1","agent":"copilot","sessionId":"","names":["COPILOT_GITHUB_TOKEN"]}
```
-The Runner refuses a Copilot token without a matching binding.
+The Runner refuses a Copilot token or a Gemini API key without a matching
+binding. For `antigravity`, the Runner also removes every other `GOOGLE_*` and
+`GEMINI_*` variable before it starts the provider, so a configured variable
+cannot redirect the key.
Core does not send a Grok subscription login. A Grok agent must use an xAI API
-key in a plugin environment.
+key in a plugin environment. Core does not send a Google sign-in yet. A Google
+Antigravity agent must use a Gemini API key in a plugin environment.
## Configured environment
diff --git a/doc/plugins/PLUGIN_RUNNER_EXECUTION.md b/doc/plugins/PLUGIN_RUNNER_EXECUTION.md
index 361ac89ffd7..36ad51a7ad4 100644
--- a/doc/plugins/PLUGIN_RUNNER_EXECUTION.md
+++ b/doc/plugins/PLUGIN_RUNNER_EXECUTION.md
@@ -103,11 +103,11 @@ reconciliation for the same task.
## Credentials and tools
Core can transfer a selected Codex account, a direct Claude credential, or the
-API credential of a Grok, Copilot or OpenCode connection. See
+API credential of a Grok, Copilot, OpenCode or Google Antigravity connection. See
[typed credentials](PLUGIN_ENVIRONMENT_TASKS.md#typed-credentials).
Other managed routes fail closed until they have a typed credential contract.
-A Grok subscription login, Claude provider routing, and an OpenCode gateway
-without a key also fail closed.
+A Grok subscription login, a Google sign-in, Claude provider routing, and an
+OpenCode gateway without a key also fail closed.
Do not put credentials in task metadata, journals, logs, or errors.
Assigned MCP tools run through the Core gateway over PRP.
diff --git a/packages/plugins/sdk/src/environment-tasks.ts b/packages/plugins/sdk/src/environment-tasks.ts
index ff2beb2c3c6..5682dee1658 100644
--- a/packages/plugins/sdk/src/environment-tasks.ts
+++ b/packages/plugins/sdk/src/environment-tasks.ts
@@ -60,11 +60,13 @@ export const ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS = {
grok: [["XAI_API_KEY"]],
copilot: [["COPILOT_GITHUB_TOKEN"]],
opencode: [["OPENROUTER_API_KEY"], ["PAPERCLIP_AI_PROVIDER_URL", "PAPERCLIP_AI_PROVIDER_KEY"]],
+ antigravity: [["GEMINI_API_KEY"]],
} as const satisfies Record;
export type PluginEnvironmentTaskCredentialProvider = keyof typeof ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS;
+const providerNames = Object.keys(ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS) as [PluginEnvironmentTaskCredentialProvider, ...PluginEnvironmentTaskCredentialProvider[]];
const providerCredential = z.object({
type: z.literal("provider-env"),
- provider: z.enum(["grok", "copilot", "opencode"]),
+ provider: z.enum(providerNames),
environment: z.record(z.string(), credentialValue),
}).strict().superRefine((credential, ctx) => {
const names = Object.keys(credential.environment).sort();
diff --git a/packages/plugins/sdk/tests/environment-task-release-resume.test.ts b/packages/plugins/sdk/tests/environment-task-release-resume.test.ts
index 50bcc60b9f0..a70ca44cf98 100644
--- a/packages/plugins/sdk/tests/environment-task-release-resume.test.ts
+++ b/packages/plugins/sdk/tests/environment-task-release-resume.test.ts
@@ -55,6 +55,17 @@ const credentials: [string, unknown, boolean][] = [
["an unsupported provider", { type: "provider-env", provider: "gemini", environment: { GEMINI_API_KEY: "fixture-gemini" } }, false],
["a provider credential without a provider", { type: "provider-env", environment: { XAI_API_KEY: "fixture-xai" } }, false],
["an extra provider credential field", { type: "provider-env", provider: "grok", environment: { XAI_API_KEY: "fixture-xai" }, home: "/home/agent" }, false],
+ ["a Gemini API key for Antigravity", { type: "provider-env", provider: "antigravity", environment: { GEMINI_API_KEY: "fixture-gemini" } }, true],
+ ["an Antigravity sign-in document", { type: "provider-env", provider: "antigravity",
+ environment: { PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET: "{\"refresh_token\":\"fixture\"}" } }, false],
+ ["a Gemini API key mixed with a sign-in document", { type: "provider-env", provider: "antigravity",
+ environment: { GEMINI_API_KEY: "fixture-gemini", PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET: "{\"refresh_token\":\"fixture\"}" } }, false],
+ ["a Google API key for Antigravity", { type: "provider-env", provider: "antigravity", environment: { GOOGLE_API_KEY: "fixture-google" } }, false],
+ ["a Gemini API key with Google routing", { type: "provider-env", provider: "antigravity",
+ environment: { GEMINI_API_KEY: "fixture-gemini", GOOGLE_GEMINI_BASE_URL: "https://router.example.test" } }, false],
+ ["no Antigravity variable", { type: "provider-env", provider: "antigravity", environment: {} }, false],
+ ["an empty Gemini API key", { type: "provider-env", provider: "antigravity", environment: { GEMINI_API_KEY: "" } }, false],
+ ["a Gemini API key for another provider", { type: "provider-env", provider: "copilot", environment: { GEMINI_API_KEY: "fixture-gemini" } }, false],
];
async function invoke(operation: unknown, handler: (params: PluginEnvironmentTaskParams) => Promise) {
diff --git a/server/src/__tests__/environment-task-runtime.test.ts b/server/src/__tests__/environment-task-runtime.test.ts
index cabd46e3808..b627aac50d0 100644
--- a/server/src/__tests__/environment-task-runtime.test.ts
+++ b/server/src/__tests__/environment-task-runtime.test.ts
@@ -328,11 +328,12 @@ describe("plugin-provided Runner execution", () => {
await expect(executeEnvironmentTask(database(value).db, worker() as never, { companyId: "company", leaseId,
operation: { ...operation, credential: { type: "claude-env", environment: { ANTHROPIC_API_KEY: "never-leak" } } } })).rejects.toThrow("validation unavailable");
});
- it.each(["grok", "copilot", "opencode"] as const)("dispatches a %s environment credential only for the matching harness", async harness => {
+ it.each(["grok", "copilot", "opencode", "antigravity"] as const)("dispatches a %s environment credential only for the matching harness", async harness => {
const credentials = {
grok: { type: "provider-env" as const, provider: "grok" as const, environment: { XAI_API_KEY: "never-leak" } },
copilot: { type: "provider-env" as const, provider: "copilot" as const, environment: { COPILOT_GITHUB_TOKEN: "never-leak" } },
opencode: { type: "provider-env" as const, provider: "opencode" as const, environment: { OPENROUTER_API_KEY: "never-leak" } },
+ antigravity: { type: "provider-env" as const, provider: "antigravity" as const, environment: { GEMINI_API_KEY: "never-leak" } },
};
const operation = { ...submit, runner: { ...submit.runner, harness }, accountIdentity: "account", credential: credentials[harness] };
const validated = () => {
@@ -341,8 +342,15 @@ describe("plugin-provided Runner execution", () => {
return value;
};
const accepted = worker();
- await expect(executeEnvironmentTask(database(validated()).db, accepted as never, { companyId: "company", leaseId, operation })).resolves.toMatchObject({ kind: "accepted" });
+ const store = database(validated());
+ await expect(executeEnvironmentTask(store.db, accepted as never, { companyId: "company", leaseId, operation })).resolves.toMatchObject({ kind: "accepted" });
expect(accepted.call).toHaveBeenCalledOnce();
+ expect(JSON.stringify(store.sets.map(set => new PgDialect().sqlToQuery(set.metadata as never).params))).not.toContain("never-leak");
+ const failing = worker();
+ failing.call.mockRejectedValue(Object.assign(new Error("submit failed for never-leak"), { data: operation }));
+ const error = await executeEnvironmentTask(database(validated()).db, failing as never, { companyId: "company", leaseId, operation }).catch(caught => caught);
+ expect(JSON.stringify({ ...error, message: error.message })).not.toContain("never-leak");
+ expect(error.cause).toBeUndefined();
const denied = worker();
await expect(executeEnvironmentTask(database(validated()).db, denied as never, { companyId: "company", leaseId,
operation: { ...operation, credential: credentials[harness === "grok" ? "copilot" : "grok"] } })).rejects.toThrow("validation unavailable");
diff --git a/server/src/__tests__/plugin-runner-credential-names.test.ts b/server/src/__tests__/plugin-runner-credential-names.test.ts
index 43b0433cbfb..c295f1eae9f 100644
--- a/server/src/__tests__/plugin-runner-credential-names.test.ts
+++ b/server/src/__tests__/plugin-runner-credential-names.test.ts
@@ -22,6 +22,8 @@ describe("plugin Runner provider credential names", () => {
it("reads the Runner's Rust allowlists", () => {
expect(rustAcpxCredentialNames("copilot")).toContain("COPILOT_GITHUB_TOKEN");
expect(rustCandidateAgents).toContain("copilot");
+ expect(rustAcpxCredentialNames("antigravity")).toContain("GEMINI_API_KEY");
+ expect(rustCandidateAgents).toContain("antigravity");
expect(rustOpenCodeNames).toContain("OPENROUTER_API_KEY");
});
@@ -48,4 +50,20 @@ describe("plugin Runner provider credential names", () => {
expect(spawned[name], `${name} reaches the ${agent} process`).toBe(environment[name]);
}
});
+
+ it("still strips Google and Gemini routing variables from the Antigravity process", () => {
+ const routing = { GOOGLE_API_KEY: "fixture-google", GOOGLE_APPLICATION_CREDENTIALS: "/controller/private/adc.json",
+ GOOGLE_CLOUD_PROJECT: "fixture-project", GOOGLE_GEMINI_BASE_URL: "https://router.example.test", GEMINI_HOME: "/controller/private/gemini" };
+ const environment = { GEMINI_API_KEY: "fixture-gemini", ...routing, PAPERCLIP_CONFIGURED_ENV_KEYS: JSON.stringify(Object.keys(routing)) };
+ const binding = createAcpxCredentialBinding(environment, "antigravity", "session");
+ const host = createAcpxSidecarHostEnvironment({ ...environment, [ACPX_CREDENTIAL_BINDING_ENV]: binding }, "antigravity", "session");
+ const spawned = createSanitizedAcpxSpawnInput(host, "antigravity").env;
+ expect(JSON.parse(binding!).names).toEqual(["GEMINI_API_KEY"]);
+ expect(host.GEMINI_API_KEY).toBe("fixture-gemini");
+ expect(spawned.GEMINI_API_KEY).toBe("fixture-gemini");
+ for (const name of Object.keys(routing)) {
+ expect(host[name], `${name} is removed at sidecar admission`).toBeUndefined();
+ expect(spawned[name], `${name} never reaches the Antigravity process`).toBeUndefined();
+ }
+ });
});
diff --git a/server/src/services/native-runtime/plugin-runner-credentials.test.ts b/server/src/services/native-runtime/plugin-runner-credentials.test.ts
index d2e1a1ed8a1..19c68e36b61 100644
--- a/server/src/services/native-runtime/plugin-runner-credentials.test.ts
+++ b/server/src/services/native-runtime/plugin-runner-credentials.test.ts
@@ -40,6 +40,36 @@ describe("plugin Runner selected credentials", () => {
});
});
+describe("plugin Runner Google Antigravity credentials", () => {
+ const signIn = "{\"refresh_token\":\"fixture-refresh\"}";
+ it("transfers only the selected Gemini API key", async () => {
+ const transfer = await preparePluginRunnerCredentials({ provider: "antigravity", identity: "revision", accountIdentity: "account",
+ environment: { GEMINI_API_KEY: "fixture-gemini", GOOGLE_API_KEY: "fixture-google", GOOGLE_APPLICATION_CREDENTIALS: "/controller/private/adc.json",
+ GOOGLE_GEMINI_BASE_URL: "https://router.example.test", GEMINI_HOME: "/controller/private/gemini", XAI_API_KEY: "fixture-xai",
+ HOME: "/controller/private", OTHER_SECRET: "fixture-unrelated" } });
+ expect(transfer).toEqual({ accountIdentity: "account", credential: { type: "provider-env", provider: "antigravity", environment: { GEMINI_API_KEY: "fixture-gemini" } } });
+ expect(transfer.needsWriteback).toBeUndefined();
+ expect(transfer.onCredentials).toBeUndefined();
+ });
+ it.each([
+ ["a Google sign-in", { PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET: signIn }],
+ ["a Google sign-in beside a Gemini API key", { GEMINI_API_KEY: "fixture-gemini", PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET: signIn }],
+ ["no key", {}],
+ ["an empty key", { GEMINI_API_KEY: "" }],
+ ["a blank key", { GEMINI_API_KEY: " " }],
+ ["only a Google API key", { GOOGLE_API_KEY: "fixture-google" }],
+ ] as const)("refuses %s because only a Gemini API key can be transferred", async (_name, environment) => {
+ const result = preparePluginRunnerCredentials({ provider: "antigravity", identity: "revision", environment });
+ await expect(result).rejects.toThrow("Google Antigravity only with a Gemini API key");
+ await result.catch((error: Error) => expect(error.message).not.toContain("fixture"));
+ });
+ it("fails closed for an invalid Gemini API key without echoing it", async () => {
+ const result = preparePluginRunnerCredentials({ provider: "antigravity", identity: "revision", environment: { GEMINI_API_KEY: "fixture\0gemini" } });
+ await expect(result).rejects.toThrow("Plugin Runner selected credential unavailable");
+ await result.catch((error: Error) => expect(error.message).not.toContain("fixture"));
+ });
+});
+
describe("plugin Runner provider environment credentials", () => {
const blanks = { XAI_API_KEY: "", COPILOT_GITHUB_TOKEN: "", OPENROUTER_API_KEY: "", PAPERCLIP_AI_PROVIDER_URL: "", PAPERCLIP_AI_PROVIDER_KEY: "",
ANTHROPIC_API_KEY: "", HOME: "/controller/private", GROK_HOME: "/controller/private/provider", OTHER_SECRET: "fixture-unrelated" };
diff --git a/server/src/services/native-runtime/plugin-runner-credentials.ts b/server/src/services/native-runtime/plugin-runner-credentials.ts
index b4060632cdb..5c8b558b682 100644
--- a/server/src/services/native-runtime/plugin-runner-credentials.ts
+++ b/server/src/services/native-runtime/plugin-runner-credentials.ts
@@ -7,6 +7,8 @@ import {
} from "@paperclipai/plugin-sdk";
import { readLocalAiCredentialFile } from "../local-ai-credential-file.js";
+const ANTIGRAVITY_SIGN_IN_ENV = "PAPERCLIP_ACPX_ANTIGRAVITY_AUTH_JSON_SECRET";
+
interface PreparedPluginRunnerCredentials {
githubBroker?: { url: string; token: string };
accountIdentity?: string;
@@ -51,12 +53,15 @@ export async function preparePluginRunnerCredentials(input: {
.flatMap(key => input.environment[key] ? [[key, input.environment[key]]] : []));
return { ...github, accountIdentity, credential: environmentTaskCredentialSchema.parse({ type: "claude-env", environment }) };
}
- if (input.provider === "grok" || input.provider === "copilot" || input.provider === "opencode") {
+ if (input.provider === "grok" || input.provider === "copilot" || input.provider === "opencode" || input.provider === "antigravity") {
const provider: PluginEnvironmentTaskCredentialProvider = input.provider;
if (provider === "grok") {
if (input.environment.XAI_BASE_URL) throw new Error("Plugin Runner does not support the selected provider routing");
if (!input.environment.XAI_API_KEY) throw new Error("Plugin Runner supports Grok only with an xAI API key. Grok subscription login is not supported.");
}
+ if (provider === "antigravity" && (input.environment[ANTIGRAVITY_SIGN_IN_ENV] || !input.environment.GEMINI_API_KEY?.trim())) {
+ throw new Error("Plugin Runner supports Google Antigravity only with a Gemini API key. Google sign-in is not supported.");
+ }
const names = new Set(ENVIRONMENT_TASK_PROVIDER_CREDENTIAL_KEY_SETS[provider].flat());
const environment = Object.fromEntries([...names]
.flatMap(key => input.environment[key] ? [[key, input.environment[key]]] : []));
diff --git a/tests/runner-e2e/source-sdk-public-inputs.json b/tests/runner-e2e/source-sdk-public-inputs.json
index d51364e61b7..b804278051b 100644
--- a/tests/runner-e2e/source-sdk-public-inputs.json
+++ b/tests/runner-e2e/source-sdk-public-inputs.json
@@ -13,7 +13,7 @@
"packages/plugins/sdk/src/environment-stop-error.ts": "b0e03f8aa2b2170ba095da5c7138050fced3f3cb",
"packages/plugins/sdk/src/environment-sync-error.ts": "7d6a51a95da49a7da4525aebbab6382dc5c44ae8",
"packages/plugins/sdk/src/environment-task-error.ts": "98aae8a06743b38884b68cb9a3ec44c57b34c0e4",
- "packages/plugins/sdk/src/environment-tasks.ts": "ff2beb2c3c6af2e6b84bad8701367d8aee3c755d",
+ "packages/plugins/sdk/src/environment-tasks.ts": "5682dee1658ad44f61f8480ef22a3a8e80eedf8f",
"packages/plugins/sdk/src/host-client-factory.ts": "e0301c390ea13f2340b669383f07af2455e48c8a",
"packages/plugins/sdk/src/idle-drain.test.ts": "cc59f7881e7d46c89395a1d93d74f6c6b9b0a64a",
"packages/plugins/sdk/src/idle-drain.ts": "ae6e4c6be4657a3d541396922b3bc551b8db557f",