Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity no longer links skills to a dangling folder on Windows #32124

Openmthsmb(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/32124/headopened View on GitHub

Follow-up to #27153. Refs #27057.

Problem

#27153 stops linkAntigravityUserSkills from linking a profile skill folder when its ~/.gemini target is missing, because the Antigravity harness's mkdir fails on a dangling junction and session/new returns -32603 (#27057). Two gaps are left on Windows:

  1. The target check uses fs.exists(), which calls access(). On Windows, access() succeeds on a dangling junction. When ~/.gemini/config/skills or ~/.gemini/antigravity-cli/skills is itself a junction to a missing folder (for example, a removed dotfiles or synced folder), the profile still gets a dangling junction. session/new then fails exactly as in #27057.
  2. The skills test is gated by skipIf(!symlinksSupported). That probe creates a file symlink, which Windows only allows with Developer Mode or elevation. CI has no Windows runner, so the test has never run on Windows, the only platform with this bug.

Change

  • antigravityAuthSupport.ts: check the target with fs.stat() and require type === "Directory". stat follows the link, so a dangling junction or symlink reports NotFound. Other errors still go to the existing warning path, and the error channel stays never.
  • antigravityAuthSupport.test.ts: the fixture creates links with NodeFSP.symlink(..., "junction") instead of Effect's untyped fs.symlink. Junctions need no privilege on Windows, and other platforms ignore the type argument. The symlinksSupported gate is removed. The existing case gets one more row: a target that is a junction to a missing folder must not be linked.

Scope and approval route

This is a small, focused fix for an obvious bug, and a direct follow-up to #27153, which already established the problem and the intended behavior in #27057. It solves one problem: skills linking can still leave a dangling junction on Windows. The test change belongs to the same fix. The new regression row only fails on Windows, and the old gate skipped the test on every Windows machine without Developer Mode, so without the ungated fixture the fix would have no test that can fail. No docs change: docs/internals/providers.md only says the profile links these folders, which stays true.

Verification

Environment: Windows 11 Pro (build 26200), Developer Mode off, Node 24.12.0, base origin/main 6577c6b618.

Unit test. cd apps/server && vp test run src/provider/antigravityAuthSupport.test.ts

CodeResult
origin/main23 passed, 3 skipped. The skills test is skipped (↓ links only the user's existing global skill directories ...).
This branch24 passed, 2 skipped. The skills test runs and passes. The two remaining skips are the CA-bundle tests, which are gated off on win32.
This branch's test with origin/main's antigravityAuthSupport.ts (git show origin/main:apps/server/src/provider/antigravityAuthSupport.ts > apps/server/src/provider/antigravityAuthSupport.ts, then vp test run src/provider/antigravityAuthSupport.test.ts -t "links only")Fails at the new row, expect(yield* isLink(cliLink)).toBe(false): AssertionError: expected true to be false.

On Linux and macOS the new row also passes on origin/main, because access() already reports a dangling symlink as missing there. The bug is Windows-only, so the row only fails on Windows.

Real harness. I used the managed Antigravity ACP runtime 1.4.1 (agy_acp_server.exe and localharness_external.exe), copied to a temp folder. A throwaway script (not committed) ran prepareAntigravityProfile and buildAntigravityAcpSpawnInput. Every path was a fresh temp root: profile, home (USERPROFILE/HOME), TEMP, APPDATA, LOCALAPPDATA and the project. The script used gemini-api-key mode with a dummy key, so session/new runs without OAuth. It then sent initialize and session/new over stdio, and the root was deleted afterwards.

Scenarioorigin/mainThis branch
~/.gemini/config/skills is a junction to a missing folderThe profile gets a dangling junction. session/new fails: -32603 Internal error, details failed to create workspace folder "file:///<root>/profile/config/skills": mkdir <root>/profile/config/skills: Cannot create a file when that file already exists.No link. session/new succeeds, and the harness creates empty config/skills and antigravity-cli/skills.
Profile with dangling junctions left by versions before #27153(fixed by #27153)Both are removed. session/new succeeds.
Fresh profile, then the user creates both ~/.gemini skill folders(fixed by #27153)The first launch succeeds with empty placeholders. The next launch replaces them with live junctions, and session/new succeeds.

Changed-files check. vp run check:changed: format, lint, knip, graphql and typecheck pass. Its test step could not start on this machine, because vitest binds 127.0.0.1:64802, which falls inside a TCP port range Windows reserves here (64755–64854, listen EACCES). I ran the same selected files from the package instead: cd apps/server && vp test run src/provider/antigravityAuthSupport.test.ts src/provider/AgentContextBudget.test.ts gave 26 passed and 2 skipped.

Not verified:

  • The ungated test on Linux and macOS. CI covers both. Node ignores the "junction" type there, and other tests in the repo use the same fixture.
  • The on-demand Windows lane. A maintainer can run it with gh workflow run windows-tests.yml --ref <branch> -f package=apps/server -f files=src/provider/antigravityAuthSupport.test.ts.
  • OAuth sign-in and model refresh end to end in the app.

Written with Claude Opus 5.5 in Claude Code, running in T3 Code. The independent review used Claude Sonnet 5.5.

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 738e83b

      Macroscope's review found this PR approvable — Antigravity now verifies that skill-link targets are directories, avoiding dangling Windows junctions. The change retains existing profile-link cleanup and warning-only error handling without altering source skill contents or product defaults.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The skill-linking function now checks whether each target is a directory. Tests create junctions with Node’s filesystem API and cover a dangling user skill-directory link.

      Changes: Antigravity skills linking

      Layer / File(s)Summary
      Validate skill targets
      apps/server/src/provider/antigravityAuthSupport.ts, apps/server/src/provider/antigravityAuthSupport.test.ts
      linkAntigravityUserSkills uses stat to check whether each target is a directory. The tests remove the symlink-support gate, create junctions with Node’s filesystem API, and cover a dangling user skill-directory link.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Possibly related issues

      • pingdotgg/t3code#19681: The issue reports Windows test setup failures when symlink creation is denied. This change uses junctions in the Antigravity test fixture and removes the symlink-support gate.

      Possibly related PRs

      • pingdotgg/t3code#30140: This PR changes the same Antigravity user-skill linking path controlled by prepareAntigravityProfile.
      • pingdotgg/t3code#27153: Both PRs handle missing Antigravity skill directories. This change uses fs.stat to detect targets that are not directories.

      Suggested labels: size:S

      Suggested reviewers: medy17

      Merge Risk: Minimal · up to c4b05

      No actionable merge-blocking risk was identified in the skill-link change.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title clearly summarizes the Windows-specific fix for dangling Antigravity skill links.
      Description checkPassedThe description explains the problem, change, scope and approval route, and verification results. It also states which checks were not completed.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 738e83b0aa82fd775ebc68a8ed8a542ffb556093 and c4b0543d0cc10a345a5f1573540b4b4d2ce1bb8a.

      Files selected for processing: 2

      • apps/server/src/provider/antigravityAuthSupport.test.ts
      • apps/server/src/provider/antigravityAuthSupport.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

    4. Note

      Written by claude-opus-5-5 on behalf of Maria

      Merged current main into the branch (merge commit, no rebase). The only conflict was the import block in antigravityAuthSupport.test.ts; kept the NodeFSP junction import and main's new preflight test imports. No other changes. vp run check:changed and antigravityAuthSupport.test.ts (29 tests) pass on the merge.

    5. tanstack-source added labelsbug

Sign in to join this conversation.