Antigravity CLI source never becomes ready: readiness probe uses GetUnleashData, which agy 1.5.x answers with 404

Aperta
#168 1 commento 1 reazione 0 assegnatari Vedi su GitHub

@prakersh ci sta già lavorando.

Dal 25/11/2026.

  • #169 di @prakersh — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, shell
Ambito
backend, cli

Direzione di ricerca

Start in internal/api/antigravity_client.go at probePort (around lines 589-614), which decides readiness by POSTing GetUnleashData and accepting only 200/401, and trace its caller awaitReady in internal/api/antigravity_cli.go. Reproduce with the two curl calls in the issue against a running agy 1.5.x plain-HTTP port, comparing GetUnleashData (404) with RetrieveUserQuotaSummary (200). Done means the probe accepts a route agy serves, so awaitReady reaches agy session ready and polls resume.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

The Antigravity cli source never becomes ready against agy 1.5.15, so onWatch keeps tearing the managed session down and inserts no new Antigravity snapshots. The Antigravity card therefore freezes at whatever was last captured (in my case via the ide source), and every 30 s poll is spent killing and relaunching agy.

Cause: the readiness probe POSTs .../LanguageServerService/GetUnleashData and only accepts HTTP 200/401. The agy 1.5.x language server does not serve that path — it answers a bare 404 page not found — while the RPCs onWatch actually needs (RetrieveUserQuotaSummary, GetUserStatus) still return 200 on the same port.

Same probe exists in v2.14.14 (installed), v2.14.17 (latest release) and in main today, so upgrading does not help.

Environment

  • macOS 14.8.5 (Apple Silicon)
  • onWatch v2.14.14, ANTIGRAVITY_ENABLED=true, ANTIGRAVITY_SOURCE=both
  • agy CLI 1.5.15 (agy --version)
  • internal/api/antigravity_client.go probePort (main: lines 589-614), used by internal/api/antigravity_cli.go awaitReady

Observed behaviour

From 2026-11-21T23:57 local onward, every poll cycle logs:

level=WARN  msg="agy session unhealthy, tearing down for relaunch" component=antigravity-cli failures=2
level=ERROR msg="Failed to fetch Antigravity quotas" source=both error="antigravity: language server process not found"

~2038 such failures over two days; zero Antigravity poll complete lines and zero new antigravity_snapshots rows with source='cli' after that timestamp. The managed agy is launched, lives ~90 s, is killed, and the loop repeats. Nothing in the wrapper's own log is an error — the session simply never reaches agy session ready.

Why the probe cannot succeed

agy 1.5.x now listens twice and says so in its own log:

Language server listening on random port at <A> for HTTPS (gRPC)
Language server listening on random port at <B> for HTTP

With the CSRF token agy was launched with (agy --csrf_token <hex>), against the plain-HTTP port <B>:

# probe path used by onWatch -> plain mux 404, not a Connect "unimplemented" payload
curl -s -X POST http://127.0.0.1:<B>/exa.language_server_pb.LanguageServerService/GetUnleashData \
  -H 'Content-Type: application/json' -H 'Connect-Protocol-Version: 1' \
  -H 'X-Codeium-Csrf-Token: <hex>' -d '{"wrapper_data":{}}' -w '\n%{http_code}\n'
# 404 page not found
# 404

# the RPC onWatch needs still works fine
curl -s -X POST http://127.0.0.1:<B>/exa.language_server_pb.LanguageServerService/RetrieveUserQuotaSummary \
  -H 'Content-Type: application/json' -H 'Connect-Protocol-Version: 1' \
  -H 'X-Codeium-Csrf-Token: <hex>' \
  -d '{"metadata":{"ideName":"antigravity","extensionName":"antigravity","locale":"en","ideVersion":"unknown"}}' -w '\n%{http_code}\n'
# {"response":{"groups":[{"displayName":"Gemini Models","buckets":[{"bucketId":"gemini-weekly",...}]}, ...]}}
# 200

GetUserStatus also answers 200. The first listener <A> is TLS/gRPC: a plain-HTTP POST to it returns 400 (Client sent an HTTP request to an HTTPS server), which is what onWatch's HTTP fallback currently hits for that port.

So probeForConnectAPI walks both ports, gets 400/404/no-Connect-answer from every candidate, returns ErrAntigravityConnectionFailed-equivalent nil, and awaitReady times out at ErrAgyNotReady for 90 s while sessionHealthy also fails — the teardown/relaunch loop.

Suggested fix

Any one of these unblocks it:

  1. Probe a route the current agy actually serves, e.g. RetrieveUserQuotaSummary with the same metadata body the CLI runner already sends, and accept 200.
  2. Treat any HTTP status from a candidate port as "this port speaks HTTP", then validate by calling the real quota RPC before declaring the session ready.
  3. Keep GetUnleashData but also accept 404 as a sign the Connect surface is present.

Preferring the plain-HTTP listener (the one agy logs for HTTP) over the gRPC one would also cut two wasted TLS round trips per probe.

Workaround in use

A thin local wrapper is placed behind ANTIGRAVITY_CLI_PATH: it launches the real agy on a pty with the same argv, finds agy's plain-HTTP Connect port, answers the GetUnleashData probe with 200, and forwards every other path/header/body verbatim to agy. With that, agy session ready and the four weekly/5-hour buckets come back on the next poll. Happy to send the wrapper if it is useful as a reference.

Lingua principale
Go
Stelle
756
Fork
65
Merge medio
9g 4h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di onllm-dev/onWatch

Tutte le issue di onllm-dev/onWatch

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.