Files
magpie/internal/proc
yetone 1bfc6378c9 providers: Antigravity CLI's own Gemini API key is found and imported (shenggxhz on X)
shenggxhz set agy up on an AI Studio key: "modelProvider": "gemini" in
~/.gemini/antigravity-cli/settings.json, GEMINI_API_KEY exported in the
shell. `agy models` then listed Gemini 4 Carbon and Hydrogen. magpie's
model refresh didn't, because the agy-cli subscription runs agy on its
Google sign-in, whose models are the account's in Antigravity, and the
key was used nowhere in magpie.

The Providers page now finds that key on its own. A new import source,
"Antigravity CLI" (readAgySettings), reads agy's settings.json and offers
the key as the Google Gemini preset, which lists the key's models from
the Gemini API. With GOOGLE_GEMINI_BASE_URL set, it uses that endpoint's
Gemini API instead. The variables are taken from magpie's environment,
else from the login shell's: a key exported only in .zshrc is found when
magpie is opened from the Dock. proc.GeminiKeyVars are only read
(LoginEnv), never set in magpie's environment. agy on its sign-in offers
nothing. With no key the entry shows as not importable, and a key that
points at magpie itself is refused.

Not changed: the agy-cli plugin's own `agy models` reads the same
setting and, with no key in magpie's environment, fails and keeps the
old list silently. Filed as magpie-community/plugins#1218.

Run:
- red on the old code: with the appReaders entry removed, all four
  TestAgyGeminiKey* tests fail (no "agy" source); green with it.
- a real login shell on mica, in a sandbox HOME (key exported only in
  .zshrc, MAGPIE env without it): DiscoverSources gives status new,
  preset google, the key read.
- real agy 1.5.9 in a sandbox HOME: API-key mode lists the Gemini 4
  models from a list built into agy; without the key it exits 1 with the
  modelProvider error.
- go vet (darwin, GOOS=linux, GOOS=windows) for proc and provider, plus
  darwin internal/gui; gofmt -l clean.
- full `go test -timeout 45m ./...` on Linux (magpie-desktop): every
  package ok except internal/usage's TestRequestStateKeptAcrossACatalogFetchedAgain
  (#6572, filed, untouched here) and the root, internal/cli and
  internal/gui, which don't build there (no gtk4/webkitgtk-6.0 dev
  packages). Those three, plus provider and proc, ran on mote (darwin): ok.
  A first full run on mica died of a full disk (117G of shared Go build
  cache), so it tested nothing.
- GUI on Linux, Chromium + WebKit: icon-tile, import-collision,
  import-opencode, provider-discovery, import-row and i18n-keys pass,
  92 of 93. The one red is icon-tile's dim-color (#6759, red on main).
- appIcon became a table so the agy icon fits app.js's code budget
  without raising it (TestCoreScriptBudget ok).

Not tried: a real AI Studio key or a real Gemini request; the GUI import
sheet in a browser (the source shows through the existing discovery and
import sheets, with Antigravity's icon); Windows (LoginEnv is "" there,
so only magpie's own environment is read).
2026-11-16 17:59:26 +08:00
..