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 24, 09:00 UTC
fix(antigravity): distinguish session initialization auth failures (#9919)
maria committed
Sep 5, 2026 at 14:45 UTC
6349a0e68a958cc51b7b5198683c1d1db88b8d28
2 files changed
+31
-1
apps/server/src/provider/AntigravityAuth.test.ts
+28
-1
@@ -61,7 +61,7 @@ const makeHarness = Effect.fn("makeAuthTestHarness")(function* (
61
} = {},
62
) {
63
const authenticated = yield* Deferred.make<void, AcpErrors.AcpError>();
64
- const discovered = yield* Deferred.make<void>();
64
+ const discovered = yield* Deferred.make<void, AcpErrors.AcpError>();
65
const closed = yield* Deferred.make<void>();
66
const events: string[] = [];
67
let receiveAuthorizationUrl:
@@ -224,6 +224,33 @@ it.layer(NodeServices.layer)("AntigravityAuth", (it) => {
224
}),
225
);
226
227
+ it.effect(
228
+ "distinguishes a post-authentication session failure without exposing its payload",
229
+ () =>
230
+ Effect.gen(function* () {
231
+ const harness = yield* makeHarness();
232
+ yield* harness.auth.controller.start(owner);
233
+ yield* phase(harness.auth, "waiting");
234
+ yield* Deferred.succeed(harness.authenticated, undefined);
235
+ yield* Deferred.fail(
236
+ harness.discovered,
237
+ new AcpErrors.AcpRequestError({
238
+ code: -32603,
239
+ errorMessage: `Internal error ${callbackUrl}`,
240
+ method: "session/new",
241
+ }),
242
+ );
243
+ const failed = yield* phase(harness.auth, "failed");
244
+ assert.equal(
245
+ failed.message,
246
+ "Antigravity authenticated, but could not initialize a session or load models.",
247
+ );
248
+ assert.isNull(failed.authorizationUrl);
249
+ assert.deepEqual(harness.catalog(), ["previous-account-model"]);
250
+ yield* Deferred.await(harness.closed);
251
+ }),
252
+ );
253
+
254
it.effect("does not call callback HTTP success a successful Google sign-in", () =>
255
Effect.gen(function* () {
256
const harness = yield* makeHarness();
apps/server/src/provider/AntigravityAuth.ts
+3
@@ -114,6 +114,9 @@ function safeAuthFailure(cause: Cause.Cause<unknown>, usesBrowser: boolean): str
114
if (/access_denied|denied access|cancelled/i.test(error.value.errorMessage)) {
115
return "Google sign-in was not approved. Start sign-in again.";
116
}
117
+ if (error.value.method === "session/new" && error.value.code === -32603) {
118
+ return "Antigravity authenticated, but could not initialize a session or load models.";
119
+ }
120
if (!usesBrowser && error.value.code === -32602) {
121
return "Antigravity rejected the configured credentials. Check the provider settings.";
122
}