Skip to content

fix(antigravity): read the hub daemon descriptor for the local language server - #141

Merged
bernardopg merged 1 commit into
mainfrom
fix/issue-140-antigravity-hub-descriptor
Nov 24, 2026
Merged

bernardopg merged 1 commit into
mainfrom
fix/issue-140-antigravity-hub-descriptor

Conversation

@bernardopg

Copy link
Copy Markdown
Owner

Closes #140.

Problem

Antigravity 2.34+ runs its language server as a hub daemon and no longer passes --csrf_token on the command line. The token, pid and ports are written to ~/.gemini/antigravity/daemon/hub_<httpPort>.json. Local discovery found no token, so every account silently fell back to the cloud endpoint and lost pools only the running app reports.

Fix

  • Read hub_*.json descriptors first (ANTIGRAVITY_DAEMON_DIR overrides the directory). A descriptor is used only when it is a regular file owned by the user and its pid is still running, so stale descriptors from crashed daemons are ignored.
  • Send the token only to loopback ports that the descriptor's pid itself listens on, trying its httpsPort first. A descriptor naming a port another process owns never receives the token.
  • Keep the --csrf_token command-line path for older builds.
  • When the app and the agy CLI hub are signed in to the same account, summarize that account once.

Verification

  • Live test on Antigravity 2.35.0 with two signed-in accounts: the account the app is signed in to now reports Antigravity app (local language server) (on main: IDE session OAuth (refreshed)). The other account keeps its cloud numbers, and accountErrors is empty. A stale hub_*.json from a dead 2.29.0 daemon was skipped.
  • tests/test-cov-b-antigravity.sh adds descriptor cases: stale pid, preferred port order, a foreign port, a daemon with no listener, deduplication with the agy hub, and no token in argv or output. The new cases fail on main and pass here.
  • Local gates pass: check-metadata, check-changelog, check-dco, shellcheck, the full tests/test-*.sh suite, gitleaks and git diff --check. Every new statement is covered by kcov.

…ge server

Antigravity 2.34+ no longer passes --csrf_token on the language server's
command line. The hub daemon writes its pid, ports and token to
~/.gemini/antigravity/daemon/hub_<port>.json instead, so local discovery
found no token and every account silently fell back to the cloud endpoint,
losing pools only the running app reports.

Read those descriptors first, only for a daemon that is still running, and
send the token only to loopback ports that process owns, trying the
descriptor's httpsPort first. The command-line path stays for older builds.
An account already answered by one server (the app and the agy CLI hub can
share one) is not summarized again.

Closes #140

Signed-off-by: Bernardo Pinto Gomes <[email protected]>
@github-actions github-actions Bot added documentation Improvements or additions to documentation area:providers Provider adapters (providers/) area:ci CI, workflows, tooling labels Nov 24, 2026
@bernardopg
bernardopg merged commit 1921a78 into main Nov 24, 2026
20 checks passed
@bernardopg
bernardopg deleted the fix/issue-140-antigravity-hub-descriptor branch November 24, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, workflows, tooling area:providers Provider adapters (providers/) documentation Improvements or additions to documentation

Projects

None yet

1 participant