The best way to control Claude Code, Codex and more from any computer or phone
fix(antigravity): explain missing SOCKS dependency during refresh (#19660)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Wout Stiens committed
Nov 7, 2026 at 12:42 UTC
9f00ced8da5c6cd65d7a05492185154924c3705a
3 files changed
+100
-6
apps/server/scripts/acp-mock-agent.ts
+11
@@ -64,6 +64,14 @@ const failLoadSessionAfterConfigReplay =
64
process.env.T3_ACP_FAIL_LOAD_SESSION_AFTER_CONFIG_REPLAY === "1";
65
const emitLoadReplay = process.env.T3_ACP_EMIT_LOAD_REPLAY === "1";
66
const failPrompt = process.env.T3_ACP_FAIL_PROMPT === "1";
67
+// JSON for the `data` of an "Internal error" response to `session/new`, as
68
+// Antigravity sends when its runtime cannot reach its local harness.
69
+const newSessionErrorData =
70
+ process.env.T3_ACP_NEW_SESSION_ERROR_DATA === undefined
71
+ ? undefined
72
+ : Schema.decodeSync(Schema.fromJsonString(Schema.Unknown))(
73
+ process.env.T3_ACP_NEW_SESSION_ERROR_DATA,
74
+ );
75
const failPromptOrdinal = Number(process.env.T3_ACP_FAIL_PROMPT_ORDINAL);
76
const compactionPromptOrdinals = new Set(
77
(process.env.T3_ACP_COMPACTION_PROMPT_ORDINALS ?? "").split(",").map(Number),
@@ -594,6 +602,9 @@ const program = Effect.gen(function* () {
602
yield* agent.handleCreateSession(() =>
603
Effect.gen(function* () {
604
yield* requireAuthentication();
605
+ if (newSessionErrorData !== undefined) {
606
+ return yield* AcpError.AcpRequestError.internalError("Internal error", newSessionErrorData);
607
+ }
608
if (antigravityProfile) {
609
yield* publishAntigravityCommands(sessionId);
610
}
apps/server/src/provider/Drivers/AntigravityDriver.test.ts
+71
-3
@@ -77,7 +77,11 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
77
78
const makeExecutable = Effect.fn("AntigravityDriverTest.makeExecutable")(function* (
79
name: string,
80
- loginRequired = false,
80
+ options: {
81
+ readonly loginRequired?: boolean;
82
+ /** `data` of the agent's "Internal error" response to `session/new`. */
83
+ readonly newSessionErrorData?: unknown;
84
+ } = {},
85
) {
86
const directory = path.join(root, name);
87
const executablePath = path.join(directory, "agy_acp_server.par");
@@ -89,9 +93,14 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
93
executablePath,
94
[
95
"#!/bin/sh",
92
- ...(loginRequired
96
+ ...(options.loginRequired
97
? [`printf '%s\\n' ${shellQuote(ANTIGRAVITY_AUTH_STDOUT_PREFIX + authorizationUrl)}`]
98
: []),
99
+ ...(options.newSessionErrorData === undefined
100
+ ? []
101
+ : [
102
+ `export T3_ACP_NEW_SESSION_ERROR_DATA=${shellQuote(JSON.stringify(options.newSessionErrorData))}`,
103
+ ]),
104
`exec ${shellQuote(nodePath)} ${shellQuote(mockAgentPath)} "$@"`,
105
"",
106
].join("\n"),
@@ -110,7 +119,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
119
120
const first = yield* makeExecutable("runtime 'one");
121
const second = yield* makeExecutable("runtime two");
113
- const signedOut = yield* makeExecutable("runtime signed-out", true);
122
+ const signedOut = yield* makeExecutable("runtime signed-out", { loginRequired: true });
123
const controls = { selected: first, failResolution: false, beforeAcquire: Effect.void };
124
const acquisitions: Array<{ binaryPath: string | undefined; path: string | undefined }> = [];
125
const releases: Array<string | null> = [];
@@ -229,6 +238,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
238
return {
239
instance,
240
refresh,
241
+ makeExecutable,
242
fs,
243
path,
244
profileDirectory,
@@ -423,6 +433,64 @@ it.layer(layerTest)("AntigravityDriver", (it) => {
433
}).pipe(Effect.scoped),
434
);
435
436
+ it.effect.skipIf(windowsHost)(
437
+ "reports the missing SOCKS dependency when session creation fails and keeps the catalog",
438
+ () =>
439
+ Effect.gen(function* () {
440
+ const h = yield* makeHarness();
441
+ yield* h.refresh();
442
+ const before = yield* h.instance.snapshot.getSnapshot;
443
+ h.controls.selected = yield* h.makeExecutable("runtime socks", {
444
+ newSessionErrorData: { details: "python-socks is required to use a SOCKS proxy" },
445
+ });
446
+ const error = yield* h.refresh().pipe(Effect.flip);
447
+ expect(error.detail).toBe(
448
+ "Could not refresh Antigravity models. The previous model list is unchanged. Antigravity reported: python-socks is required to use a SOCKS proxy",
449
+ );
450
+ const after = yield* h.instance.snapshot.getSnapshot;
451
+ expect(after.models).toEqual(before.models);
452
+ expect(after.auth).toEqual(before.auth);
453
+ yield* h.assertClosed;
454
+ }).pipe(Effect.scoped),
455
+ );
456
+
457
+ it.effect.skipIf(windowsHost)(
458
+ "never copies unrecognized agent error details into the refresh error",
459
+ () =>
460
+ Effect.gen(function* () {
461
+ const h = yield* makeHarness();
462
+ yield* h.refresh();
463
+ const before = yield* h.instance.snapshot.getSnapshot;
464
+ const generic =
465
+ "Could not refresh Antigravity models. The previous model list is unchanged.";
466
+ const secret = "https://accounts.example.test/o/oauth2?code=sk-secret-123";
467
+ h.controls.selected = yield* h.makeExecutable("runtime socks with extra", {
468
+ newSessionErrorData: {
469
+ details: `Traceback (most recent call last):\n proxy ${secret}\npython-socks is required to use a SOCKS proxy`,
470
+ },
471
+ });
472
+ const known = yield* h.refresh().pipe(Effect.flip);
473
+ expect(known.detail).toBe(
474
+ `${generic} Antigravity reported: python-socks is required to use a SOCKS proxy`,
475
+ );
476
+
477
+ for (const [name, data] of [
478
+ ["runtime unknown details", { details: `Token refresh failed for ${secret}` }],
479
+ ["runtime object details", { details: { stack: "secret frame", env: { HOME: "/" } } }],
480
+ ["runtime no details", ["python-socks is required to use a SOCKS proxy"]],
481
+ ] as const) {
482
+ h.controls.selected = yield* h.makeExecutable(name, { newSessionErrorData: data });
483
+ const error = yield* h.refresh().pipe(Effect.flip);
484
+ expect(error.detail).toBe(generic);
485
+ }
486
+ const after = yield* h.instance.snapshot.getSnapshot;
487
+ expect(after.models).toEqual(before.models);
488
+ expect(after.auth).toEqual(before.auth);
489
+ expect(JSON.stringify(after)).not.toContain("sk-secret-123");
490
+ yield* h.assertClosed;
491
+ }).pipe(Effect.scoped),
492
+ );
493
+
494
it.effect.skipIf(windowsHost)(
495
"removes runtime temp directories left by a previous server on create",
496
() =>
apps/server/src/provider/Drivers/AntigravityDriver.ts
+18
-3
@@ -23,7 +23,7 @@ import * as Scope from "effect/Scope";
23
import * as Stream from "effect/Stream";
24
import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
25
import { HttpClient } from "effect/http";
26
-import type { AcpError } from "effect-acp/errors";
26
+import * as AcpErrors from "effect-acp/errors";
27
28
import * as ProviderHost from "@t3tools/provider-core/server/ProviderHost";
29
import {
@@ -76,6 +76,21 @@ import { discoverAntigravitySkills, resolveAntigravityUserHome } from "./Antigra
76
const DRIVER = ProviderDriverKind.make("antigravity");
77
const decodeSettings = Schema.decodeSync(AntigravitySettings);
78
const isNodeRuntimeUnavailableError = Schema.is(NodeRuntimeUnavailableError);
79
+const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError);
80
+const isAcpErrorDetails = Schema.is(Schema.Struct({ details: Schema.String }));
81
+const REFRESH_FAILED =
82
+ "Could not refresh Antigravity models. The previous model list is unchanged.";
83
+const PYTHON_SOCKS_REQUIRED = "python-socks is required to use a SOCKS proxy";
84
+
85
+// Keep upstream diagnostics in cause; only recognized, fixed text reaches clients.
86
+function refreshFailureDetail(cause: unknown) {
87
+ return isAcpRequestError(cause) &&
88
+ cause.operation === "receive-response" &&
89
+ isAcpErrorDetails(cause.data) &&
90
+ cause.data.details.includes(PYTHON_SOCKS_REQUIRED)
91
+ ? `${REFRESH_FAILED} Antigravity reported: ${PYTHON_SOCKS_REQUIRED}`
92
+ : REFRESH_FAILED;
93
+}
94
95
export type AntigravityDriverEnv =
96
| AntigravityInstallation.AntigravityInstallation
@@ -185,7 +200,7 @@ export const AntigravityDriver: ProviderDriver<
200
input: Omit<AntigravityAcpRuntimeInput, "spawn" | "childProcessSpawner">,
201
): Effect.fn.Return<
202
AcpSessionRuntime.AcpSessionRuntime["Service"],
188
- AcpError | ProviderSetupError,
203
+ AcpErrors.AcpError | ProviderSetupError,
204
Scope.Scope
205
> {
206
if (authConfigIssue !== null) {
@@ -513,7 +528,7 @@ export const AntigravityDriver: ProviderDriver<
528
: cause._tag === "ProviderSetupError" &&
529
(cause.operation === "configure" || cause.operation === "start")
530
? cause.detail
516
- : "Could not refresh Antigravity models. The previous model list is unchanged.",
531
+ : refreshFailureDetail(cause),
532
cause,
533
}),
534
),