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, 02:00 UTC
fix(antigravity): agy CLI threads open in Full access and Auto-accept edits (#33143)
The agy CLI rejects the managed runtime's yolo and auto_edit session modes, so Full access and Auto-accept edits threads failed to open. The CLI now stays in default mode and T3 answers its permission requests from the live policy. Takes over #32875. Co-authored-by: Peng Yue <padyue@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Nov 8, 2026 at 17:04 UTC
51675e047378e108f6b3cdcae9f3c89a700f6ab2
4 files changed
+60
-2
apps/server/scripts/acp-mock-agent.ts
+1
-1
@@ -97,7 +97,7 @@ const permissionOptionIds = {
97
const sessionId = "mock-session-1";
98
99
let currentModeId = antigravityProfile
100
- ? "default"
100
+ ? (process.env.T3_ACP_INITIAL_MODE ?? "default")
101
: copilotModesProfile
102
? copilotModeId("agent")
103
: "ask";
apps/server/src/provider/Drivers/AntigravityDriver.test.ts
+46
-1
@@ -81,6 +81,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
81
readonly loginRequired?: boolean;
82
/** `data` of the agent's "Internal error" response to `session/new`. */
83
readonly newSessionErrorData?: unknown;
84
+ readonly initialMode?: string;
85
} = {},
86
) {
87
const directory = path.join(root, name);
@@ -101,6 +102,9 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
102
: [
103
`export T3_ACP_NEW_SESSION_ERROR_DATA=${shellQuote(JSON.stringify(options.newSessionErrorData))}`,
104
]),
105
+ ...(options.initialMode === undefined
106
+ ? []
107
+ : [`export T3_ACP_INITIAL_MODE=${shellQuote(options.initialMode)}`]),
108
`exec ${shellQuote(nodePath)} ${shellQuote(mockAgentPath)} "$@"`,
109
"",
110
].join("\n"),
@@ -120,7 +124,11 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
124
const first = yield* makeExecutable("runtime 'one");
125
const second = yield* makeExecutable("runtime two");
126
const signedOut = yield* makeExecutable("runtime signed-out", { loginRequired: true });
123
- const controls = { selected: first, failResolution: false, beforeAcquire: Effect.void };
127
+ const controls: {
128
+ selected: AntigravityInstallation.AntigravityExecutable;
129
+ failResolution: boolean;
130
+ beforeAcquire: Effect.Effect<void>;
131
+ } = { selected: first, failResolution: false, beforeAcquire: Effect.void };
132
const acquisitions: Array<{ binaryPath: string | undefined; path: string | undefined }> = [];
133
const releases: Array<string | null> = [];
134
const launches: Array<{
@@ -393,6 +401,43 @@ it.layer(layerTest)("AntigravityDriver", (it) => {
401
elicitation: { form: {} },
402
},
403
]);
404
+
405
+ // The agy CLI rejects `yolo` and `auto_edit`; it stays in `default` and T3 answers its requests.
406
+ h.controls.selected = {
407
+ ...(yield* h.makeExecutable("runtime cli", { initialMode: "auto_edit" })),
408
+ harnessPath: null,
409
+ };
410
+ for (const runtimeMode of ["full-access", "auto-accept-edits"] as const) {
411
+ const requestsBefore = (yield* h.readRequests).length;
412
+ const cliThreadId = ThreadId.make(`thread-antigravity-cli-${runtimeMode}`);
413
+ const cliPolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
414
+ runtimeMode,
415
+ interactionMode: "default",
416
+ cwd: workspace,
417
+ });
418
+ const cliSession = yield* h.instance.orchestrationAdapter.openSession({
419
+ threadId: cliThreadId,
420
+ providerSessionId: ProviderSessionId.make(`provider-session-cli-${runtimeMode}`),
421
+ modelSelection,
422
+ runtimePolicy: cliPolicy,
423
+ });
424
+ yield* cliSession.ensureThread({
425
+ threadId: cliThreadId,
426
+ modelSelection,
427
+ runtimePolicy: cliPolicy,
428
+ });
429
+ expect(h.launches.at(-1)?.args).toEqual(["acp"]);
430
+ expect(
431
+ (yield* h.readRequests)
432
+ .slice(requestsBefore)
433
+ .filter(
434
+ (request) =>
435
+ request.method === "session/set_config_option" &&
436
+ request.params?.configId === "mode",
437
+ )
438
+ .map((request) => request.params?.value),
439
+ ).toEqual(["default"]);
440
+ }
441
}).pipe(Effect.scoped),
442
);
443
apps/server/src/provider/Drivers/AntigravityDriver.ts
+4
@@ -44,6 +44,7 @@ import {
44
type AntigravityAuthConfig,
45
} from "../antigravityAuthSupport.ts";
46
import {
47
+ antigravityCliSessionMode,
48
antigravityModelOptions,
49
antigravityThinkingConfig,
50
makeAntigravityAcpRuntime,
@@ -282,6 +283,9 @@ export const AntigravityDriver: ProviderDriver<
283
}).pipe(Effect.provideService(SecureRandom.SecureRandom, random));
284
return {
285
...runtime,
286
+ ...(executable.harnessPath === null
287
+ ? { setMode: (modeId: string) => runtime.setMode(antigravityCliSessionMode(modeId)) }
288
+ : {}),
289
start: () =>
290
runtime
291
.start()
apps/server/src/provider/acp/AntigravityAcpSupport.ts
+9
@@ -174,6 +174,15 @@ export function antigravityPermissionMode(runtimeMode: RuntimeMode): string {
174
}
175
}
176
177
+/**
178
+ * The agy CLI rejects the managed runtime's `yolo` and `auto_edit`. It stays in `default`, where
179
+ * it asks before acting and T3 answers from the live runtime policy, so permission changes apply
180
+ * on the next turn without a restart.
181
+ */
182
+export function antigravityCliSessionMode(modeId: string): string {
183
+ return modeId === "yolo" || modeId === "auto_edit" ? "default" : modeId;
184
+}
185
+
186
/** The runtime mode an Antigravity session mode grants; the inverse of `antigravityPermissionMode`. */
187
export function antigravityRuntimeModeForSessionMode(modeId: string): RuntimeMode | undefined {
188
switch (modeId) {