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 22, 05:45 UTC
fix(server): Antigravity Auto asks instead of approving every request (#23698)
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
parmartejas committed
Nov 4, 2026 at 04:36 UTC
b6bd84d1217f4345d5d5f7376d1d353137e44491
3 files changed
+46
-1
apps/server/src/orchestration-v2/RuntimePolicy.test.ts
+25
@@ -15,6 +15,7 @@ import * as Layer from "effect/Layer";
15
import * as Stream from "effect/Stream";
16
17
import type { ProviderInstance } from "@t3tools/provider-core/server/driver";
18
+import { acpPermissionDisposition } from "@t3tools/provider-acp/server/clientPolicy";
19
import * as ServerSettings from "../serverSettings.ts";
20
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
21
import * as ProjectStore from "./ProjectStore.ts";
@@ -63,8 +64,10 @@ function makeThread(input: {
64
}
65
66
const grokInstanceId = ProviderInstanceId.make("grok");
67
+const antigravityInstanceId = ProviderInstanceId.make("antigravity");
68
const supportedRuntimeModesByInstance = new Map<ProviderInstanceId, ReadonlyArray<RuntimeMode>>([
69
[grokInstanceId, ["approval-required", "auto", "full-access"]],
70
+ [antigravityInstanceId, ["approval-required", "auto-accept-edits", "full-access"]],
71
]);
72
const providerInstanceFor = (instanceId: ProviderInstanceId) =>
73
({
@@ -113,6 +116,28 @@ const layerWithPolicy = (policy?: ManagedPolicySummary) =>
116
const layerTest = layerWithPolicy();
117
118
it.layer(layerTest)("RuntimePolicyV2", (it) => {
119
+ it.effect("asks for Antigravity command approval when a stored Auto thread falls back", () =>
120
+ Effect.gen(function* () {
121
+ const policy = yield* RuntimePolicy.RuntimePolicyV2;
122
+ const now = yield* DateTime.now;
123
+ const resolve = (runtimeMode: RuntimeMode) =>
124
+ policy.resolve({
125
+ thread: makeThread({ now, worktreePath: null, runtimeMode }),
126
+ modelSelection: { instanceId: antigravityInstanceId, model: "test-model" },
127
+ });
128
+ const request = {
129
+ sessionId: "session-1",
130
+ toolCall: { toolCallId: "command-1", title: "Run command", kind: "execute" as const },
131
+ options: [{ optionId: "allow", name: "Allow", kind: "allow_once" as const }],
132
+ };
133
+ const auto = yield* resolve("auto");
134
+ assert.equal(auto.runtimeMode, "approval-required");
135
+ assert.equal(acpPermissionDisposition(auto, request), "ask");
136
+ assert.equal(acpPermissionDisposition(yield* resolve("auto-accept-edits"), request), "ask");
137
+ assert.equal(acpPermissionDisposition(yield* resolve("full-access"), request), "allow");
138
+ }),
139
+ );
140
+
141
it.effect("runs a mode the provider does not offer in Supervised", () =>
142
Effect.gen(function* () {
143
const policy = yield* RuntimePolicy.RuntimePolicyV2;
apps/server/src/provider/AntigravityProvider.test.ts
+15
@@ -348,6 +348,21 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
348
),
349
);
350
351
+ it.effect("does not offer Auto, so Auto threads fall back to Supervised", () =>
352
+ Effect.scoped(
353
+ Effect.gen(function* () {
354
+ const harness = yield* makeHarness();
355
+ yield* harness.initialize;
356
+ // Antigravity has no automatic review; the shared ACP policy would approve every request.
357
+ expect((yield* harness.provider.snapshot.getSnapshot).supportedRuntimeModes).toEqual([
358
+ "approval-required",
359
+ "auto-accept-edits",
360
+ "full-access",
361
+ ]);
362
+ }),
363
+ ),
364
+ );
365
+
366
it.effect("publishes session metadata and native commands without another health probe", () =>
367
Effect.scoped(
368
Effect.gen(function* () {
apps/server/src/provider/AntigravityProvider.ts
+6
-1
@@ -182,7 +182,12 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
182
const checkedAt = DateTime.formatIso(yield* DateTime.now);
183
const initialDraft = {
184
...buildServerProvider({
185
- presentation: { displayName: "Antigravity", showInteractionModeToggle: false },
185
+ presentation: {
186
+ displayName: "Antigravity",
187
+ showInteractionModeToggle: false,
188
+ // No automatic review, so Auto falls back to Supervised instead of approving everything.
189
+ supportedRuntimeModes: ["approval-required", "auto-accept-edits", "full-access"],
190
+ },
191
enabled: settings.enabled,
192
checkedAt,
193
models: [],