@devries-cameron20 / t3code Mirror · read-only / commits / 320ab2a2ac
Fork 0

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 21, 04:45 UTC

fix(server): Antigravity drops a stale sign-in failure once a session signs in (#39443)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 19, 2026 at 17:49 UTC 320ab2a2ac89c374533fb9d2f942b2c6bebf9bf8
3 files changed +18 -2
apps/server/src/provider/AntigravityAuth.test.ts
+4
@@ -358,6 +358,10 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("AntigravityAuth"
358 yield* TestClock.adjust("270 seconds");
359 const failed = yield* phase(harness.auth, "failed");
360 assert.include(failed.message ?? "", "could not reach Google");
361 +
362 + yield* harness.auth.onSignedInElsewhere;
363 + const cleared = yield* phase(harness.auth, "idle");
364 + assert.isNull(cleared.message);
365 }),
366 );
367
apps/server/src/provider/AntigravityAuth.ts
+11 -1
@@ -82,6 +82,8 @@ export interface AntigravityAuth {
82 stop: Effect.Effect<void>,
83 task: Effect.Effect<A, E, R>,
84 ) => Effect.Effect<A, E | ProviderSetupError, R | Scope.Scope>;
85 + /** A session started outside a flow, so an earlier flow's failure no longer describes sign-in. */
86 + readonly onSignedInElsewhere: Effect.Effect<void>;
87 }
88
89 /** `agy acp --login`: it prints a Google link and reads the code the Antigravity page shows. */
@@ -703,5 +705,13 @@ export const makeAntigravityAuth = Effect.fn("makeAntigravityAuth")(function* <
705 }),
706 );
707
706 - return { controller, withProcess };
708 + const onSignedInElsewhere = SubscriptionRef.update(snapshot, (value) =>
709 + activeFlow === undefined &&
710 + operation === "idle" &&
711 + (value.state.phase === "failed" || value.state.phase === "cancelled")
712 + ? { ownerSessionId: null, state: emptyState }
713 + : value,
714 + );
715 +
716 + return { controller, withProcess, onSignedInElsewhere };
717 });
apps/server/src/provider/Drivers/AntigravityDriver.ts
+3 -1
@@ -481,6 +481,7 @@ export const AntigravityDriver: ProviderDriver<
481 >,
482 ) {
483 yield* provider.onSessionStarted(started);
484 + yield* authFlow.onSignedInElsewhere;
485 yield* Stream.runForEach(runtime.getEvents(), (event) => {
486 if (event._tag === "EventStreamBarrier") {
487 return Deferred.succeed(event.acknowledge, undefined).pipe(Effect.asVoid);
@@ -600,7 +601,8 @@ export const AntigravityDriver: ProviderDriver<
601 ),
602 ),
603 profileDirectory,
603 - onSessionStarted: provider.onSessionStarted,
604 + onSessionStarted: (started, cwd) =>
605 + provider.onSessionStarted(started, cwd).pipe(Effect.andThen(authFlow.onSignedInElsewhere)),
606 onSessionEvent: (event, cwd) => {
607 if (event._tag === "ConfigOptionsUpdated") {
608 return provider.onConfigOptionsUpdated(event.configOptions);