@devries-cameron20 / t3code-1 / commits / a6e2236c4d
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): Antigravity failed logins due to missing skills folders (#27153)

Co-authored-by: maria-rcks <maria@kuuro.net>

Ahmed Arat committed Oct 31, 2026 at 16:37 UTC a6e2236c4d4ed2f655c42e1766b8c79214ff4075
2 files changed +39 -4
apps/server/src/provider/antigravityAuthSupport.test.ts
+22 -4
@@ -577,7 +577,7 @@ it.layer(NodeServices.layer)("Antigravity profile preparation", (it) => {
577 );
578
579 it.effect.skipIf(!symlinksSupported)(
580 - "links the user's global skill directories into the profile without touching real content",
580 + "links only the user's existing global skill directories without touching real content",
581 () =>
582 Effect.gen(function* () {
583 const fs = yield* FileSystem.FileSystem;
@@ -587,26 +587,44 @@ it.layer(NodeServices.layer)("Antigravity profile preparation", (it) => {
587 const profileDirectory = path.join(temporaryDirectory, "profile");
588 const configSkills = path.join(userHome, ".gemini", "config", "skills");
589 const cliSkills = path.join(userHome, ".gemini", "antigravity-cli", "skills");
590 + const isLink = (link: string) =>
591 + fs.readLink(link).pipe(
592 + Effect.as(true),
593 + Effect.catchReason("PlatformError", "NotFound", () => Effect.succeed(false)),
594 + );
595 yield* fs.makeDirectory(path.join(configSkills, "review"), { recursive: true });
596
597 yield* prepareAntigravityProfile({ profileDirectory, userHome });
598 const configLink = path.join(profileDirectory, "config", "skills");
599 const cliLink = path.join(profileDirectory, "antigravity-cli", "skills");
600 expect(yield* fs.readLink(configLink)).toBe(configSkills);
596 - expect(yield* fs.readLink(cliLink)).toBe(cliSkills);
601 + expect(yield* isLink(cliLink)).toBe(false);
602 expect(yield* fs.exists(path.join(configLink, "review"))).toBe(true);
603 expect(yield* fs.exists(path.join(profileDirectory, "config", "mcp_config.json"))).toBe(
604 false,
605 );
606
602 - yield* fs.remove(cliLink);
603 - yield* fs.symlink(path.join(temporaryDirectory, "elsewhere"), cliLink);
607 + // The harness leaves an empty folder where the link was skipped.
608 + yield* fs.makeDirectory(cliLink, { recursive: true });
609 + yield* prepareAntigravityProfile({ profileDirectory, userHome });
610 + expect((yield* fs.stat(cliLink)).type).toBe("Directory");
611 +
612 + yield* fs.makeDirectory(cliSkills, { recursive: true });
613 yield* fs.remove(configLink);
614 yield* fs.makeDirectory(path.join(configLink, "own-skill"), { recursive: true });
615 yield* prepareAntigravityProfile({ profileDirectory, userHome });
616 expect(yield* fs.readLink(cliLink)).toBe(cliSkills);
617 expect(yield* fs.exists(path.join(configLink, "own-skill"))).toBe(true);
618 expect((yield* fs.stat(configLink)).type).toBe("Directory");
619 +
620 + yield* fs.remove(cliLink);
621 + yield* fs.symlink(path.join(temporaryDirectory, "elsewhere"), cliLink);
622 + yield* prepareAntigravityProfile({ profileDirectory, userHome });
623 + expect(yield* fs.readLink(cliLink)).toBe(cliSkills);
624 +
625 + yield* fs.remove(cliSkills, { recursive: true });
626 + yield* prepareAntigravityProfile({ profileDirectory, userHome });
627 + expect(yield* isLink(cliLink)).toBe(false);
628 }),
629 );
630
apps/server/src/provider/antigravityAuthSupport.ts
+17
@@ -245,9 +245,26 @@ const linkAntigravityUserSkills = Effect.fn("linkAntigravityUserSkills")(functio
245 [links[1], targets[1]],
246 ] as const) {
247 yield* Effect.gen(function* () {
248 + // The harness creates these folders itself, and mkdir fails on a dangling link.
249 + if (!(yield* fs.exists(target))) {
250 + const linked = yield* fs.readLink(link).pipe(
251 + Effect.as(true),
252 + Effect.orElseSucceed(() => false),
253 + );
254 + if (linked) yield* fs.remove(link);
255 + return;
256 + }
257 const existing = yield* fs.readLink(link).pipe(
258 Effect.map((value): string | undefined => path.resolve(path.dirname(link), value)),
259 Effect.catchReason("PlatformError", "NotFound", () => Effect.undefined),
260 + // An empty folder is the harness's placeholder from a launch without the link.
261 + // rmdir refuses a non-empty folder, so content added meanwhile is never deleted.
262 + Effect.catch((error) =>
263 + Effect.tryPromise(() => NodeFSP.rmdir(link)).pipe(
264 + Effect.as(undefined),
265 + Effect.mapError(() => error),
266 + ),
267 + ),
268 );
269 if (existing === target) return;
270 if (existing !== undefined) {