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, 18:15 UTC
fix(antigravity): say when sign-in cannot reach Google (#24652)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 24, 2026 at 18:49 UTC
2887855528661ec6a154c0bd094bfb5482fbdfbf
3 files changed
+63
-2
apps/server/src/provider/AntigravityAuth.test.ts
+36
@@ -8,6 +8,7 @@ import * as Fiber from "effect/Fiber";
8
import * as Option from "effect/Option";
9
import * as Scope from "effect/Scope";
10
import * as Stream from "effect/Stream";
11
+import * as TestClock from "effect/testing/TestClock";
12
import * as AcpErrors from "effect-acp/errors";
13
import type * as AcpSchema from "effect-acp/compat";
14
@@ -62,6 +63,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* (
63
const authenticated = yield* Deferred.make<void, AcpErrors.AcpError>();
64
const discovered = yield* Deferred.make<void, AcpErrors.AcpError>();
65
const closed = yield* Deferred.make<void>();
66
+ const authenticateCalled = yield* Deferred.make<void>();
67
const events: string[] = [];
68
let receiveAuthorizationUrl:
69
| ((url: string) => Effect.Effect<void, AcpErrors.AcpError>)
@@ -92,6 +94,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* (
94
start: () =>
95
Effect.gen(function* () {
96
events.push("authenticate");
97
+ yield* Deferred.succeed(authenticateCalled, undefined);
98
if (options.interactive !== false && input.onAuthorizationUrl) {
99
for (const url of options.authorizationUrls ?? [authorizationUrl]) {
100
yield* input.onAuthorizationUrl(url);
@@ -129,6 +132,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* (
132
authenticated,
133
discovered,
134
closed,
135
+ authenticateCalled,
136
events,
137
catalog: () => catalog,
138
forwarded: () => forwarded,
@@ -254,6 +258,38 @@ it.layer(NodeServices.layer)("AntigravityAuth", (it) => {
258
}),
259
);
260
261
+ it.effect("tells the user when the agent cannot reach Google", () =>
262
+ Effect.gen(function* () {
263
+ const harness = yield* makeHarness({ interactive: false });
264
+ yield* harness.auth.controller.start(owner);
265
+ yield* Deferred.await(harness.authenticateCalled);
266
+
267
+ yield* TestClock.adjust("30 seconds");
268
+ const stalled = yield* harness.auth.controller.subscribe(owner).pipe(
269
+ Stream.filter((state) => state.message?.includes("Broken IPv6") === true),
270
+ Stream.runHead,
271
+ Effect.map(Option.getOrThrow),
272
+ );
273
+ assert.equal(stalled.phase, "starting");
274
+
275
+ yield* TestClock.adjust("270 seconds");
276
+ const failed = yield* phase(harness.auth, "failed");
277
+ assert.include(failed.message ?? "", "could not reach Google");
278
+ }),
279
+ );
280
+
281
+ it.effect("keeps the expired message once the Google link was shown", () =>
282
+ Effect.gen(function* () {
283
+ const harness = yield* makeHarness();
284
+ yield* harness.auth.controller.start(owner);
285
+ yield* phase(harness.auth, "waiting");
286
+
287
+ yield* TestClock.adjust("300 seconds");
288
+ const failed = yield* phase(harness.auth, "failed");
289
+ assert.equal(failed.message, "Google sign-in expired. Start sign-in again.");
290
+ }),
291
+ );
292
+
293
it.effect("accepts direct local or cached completion without a callback RPC", () =>
294
Effect.gen(function* () {
295
const harness = yield* makeHarness({ interactive: false });
apps/server/src/provider/AntigravityAuth.ts
+26
-1
@@ -31,6 +31,13 @@ import {
31
import type { ProviderAuthController } from "./ProviderAuthService.ts";
32
33
const AUTH_TIMEOUT_MS = 300_000;
34
+// A healthy agent shows the Google link or finishes within seconds. Its bundled Python has no
35
+// IPv4 fallback race, so a host with broken IPv6 waits about two minutes per Google request.
36
+const NO_RESPONSE_HINT_MS = 30_000;
37
+const NO_RESPONSE_MESSAGE =
38
+ "Antigravity has not reached Google after 30 seconds. Check this machine's network connection. Broken IPv6 is a common cause.";
39
+const UNREACHABLE_MESSAGE =
40
+ "Antigravity could not reach Google. Check this machine's network connection, then start sign-in again.";
41
const FORWARDING_FAILED_MESSAGE = "Could not deliver the sign-in response. Start sign-in again.";
42
const isSetupError = Schema.is(ProviderSetupError);
43
const isAcpRequestError = Schema.is(AcpErrors.AcpRequestError);
@@ -264,6 +271,17 @@ export const makeAntigravityAuth = Effect.fn("makeAntigravityAuth")(function* <
271
const runSignIn = Effect.fn("AntigravityAuth.runSignIn")(
272
function* (flow: AuthFlow, stopSessions: Effect.Effect<void, ProviderSetupError>) {
273
yield* stopSessions.pipe(Effect.ensuring(stopOwnedProcesses));
274
+ yield* Effect.sleep(NO_RESPONSE_HINT_MS).pipe(
275
+ Effect.andThen(
276
+ lock.withPermits(1)(
277
+ Effect.gen(function* () {
278
+ if (activeFlow !== flow || flow.state.phase !== "starting") return;
279
+ yield* publishFlow(flow, { ...flow.state, message: NO_RESPONSE_MESSAGE });
280
+ }),
281
+ ),
282
+ ),
283
+ Effect.forkScoped,
284
+ );
285
const runtime = yield* options.makeRuntime({
286
onAuthorizationUrl: (url) => receiveAuthorizationUrl(flow, url),
287
});
@@ -288,7 +306,14 @@ export const makeAntigravityAuth = Effect.fn("makeAntigravityAuth")(function* <
306
Effect.timeoutOrElse({
307
duration: AUTH_TIMEOUT_MS,
308
orElse: () =>
291
- Effect.fail(setupError("start", "Google sign-in expired. Start sign-in again.")),
309
+ Effect.fail(
310
+ setupError(
311
+ "start",
312
+ flow.state.phase === "starting"
313
+ ? UNREACHABLE_MESSAGE
314
+ : "Google sign-in expired. Start sign-in again.",
315
+ ),
316
+ ),
317
}),
318
Effect.exit,
319
Effect.flatMap((result) => finishFlow(flow, result)),
apps/web/src/components/settings/ProviderAuthenticationSection.tsx
+1
-1
@@ -75,7 +75,7 @@ export function ProviderAuthenticationSection({
75
(provider.driver === "acpRegistry" && auth?.methods?.length === 0));
76
const accountDescription = active
77
? auth?.phase === "starting"
78
- ? "Starting sign-in…"
78
+ ? (auth.message ?? "Starting sign-in…")
79
: auth?.phase === "verifying"
80
? "Checking your account…"
81
: interaction?.type === "terminal"