antigravity: retired, the built-in and its plugin both ask Google nothing; Antigravity is served by your own agy (agy-cli)

Google bans accounts it sees on Code Assist through Antigravity's own
client. magpie offered that route twice, the built-in and
@magpie-community/opencode-antigravity-auth, and anyone who picked
Antigravity in magpie took it by default (the owner, 11-15: 全部下线,改推
agy-cli).

- retiredBuiltins has antigravity. googleLogins lists no account of a
  subscription its plugin serves, so no list, usage read, quota read or
  request goes to Google with a built-in Antigravity account (the usage
  loop in subscription_usage.go had no gate of its own). The mover reads
  googleSavedLogins, so saved accounts still move.
- The mover's min is 0.2.0 (on the plugins dist index, b8bf5a57): that
  version sends nothing, answers every request 410 ModelDeprecated
  ("model has been retired", which modelRetired reads, so a group asks its
  next member) naming Antigravity (local agy CLI) and
  `magpie plugin add @magpie-community/opencode-agy-cli-auth`, and turns
  sign-in away. It left the plugins registry (003a38ff).
- Gemini CLI's route, on the same code, is unchanged.
- The built-in's code stays for now (shared with Gemini CLI); taking it
  out is #6723. Its 123 tests serve it again for their run through
  provider.AntigravityBuiltinForTest(), a counter BuiltinRetired reads.
- README (en, zh) and site docs subscriptions (en, zh, ja) point to
  Antigravity through the user's own agy CLI. AGENTS.md and
  provider-plugins.md say why and that neither route comes back.

What users lose: Antigravity with Google accounts signed in to magpie, and
rotating several of them. agy-cli serves the one account the user's agy is
signed in to, and needs agy installed.

Tests: TestRetiredAntigravityAsksGoogleNothing saves an Antigravity
account and checks googleLogins/googleAccountOf give nothing, the mover
still carries it, usage has no Antigravity card and the fake Google was
asked nothing, and Gemini's account still lists. Broken by hand (the
PluginServes gate removed from googleLogins): red,
"googleLogins(antigravity) = 1 accounts".

Run (mote/mica, at this change on origin/main 5bd41301b): gofmt -l clean;
go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./... and go build ./... ok; go test ./internal/gateway/ (1245s),
./internal/agent/ (419s), ./internal/provider/ (253s) ok on mica;
after rebasing on origin/main f362d3b9a: go test ./internal/provider/
(160s) and ./internal/plugin/ (184s) ok on mica.
Earlier at this change minus the test opt-ins: sessions, usage, library,
gui ok (mica). internal/cli's TestEveryRouteHasACommandOrIsNamed is red at
5bd41301b itself (/api/warm-all, #6724), not from this change.
Not run: the full ./... suite (mote and mica each had another session's
full or GUI suite); the GUI suite (no app.js change); a real move of a
built-in Antigravity account onto 0.2.0.

Plugins side: magpie-community/plugins 003a38ff (antigravity 0.2.0) and
f9155256 (agy-cli 0.1.56, comments only).
This commit is contained in:
yetone
2026-11-15 12:14:48 +08:00
parent f362d3b9af
commit 9cd5f36521
63 changed files with 257 additions and 29 deletions
+15 -5
View File
@@ -77,11 +77,21 @@ Two cases decide it:
nothing; a line over the Providers list says so, with why and a Move
(`providers.unmoved`, `unmovedLine` in app.js). With no row of its own,
the Add sheet leaves it to the Plugins page (`unusedSub`). Every
subscription in the table above is retired (10-17) except Antigravity,
which is moved but whose built-in code is still there until every
account has gone over (11-10); gates ask `provider.PluginServes(id)`
(moved or retired). Gemini CLI (`gemini`) and the agy agent stay built
in.
subscription in the table above is retired (10-17; Antigravity 11-15);
gates ask `provider.PluginServes(id)` (moved or retired). Gemini CLI
(`gemini`) and the agy agent stay built in.
- **Antigravity is off entirely** (the owner, 11-15): Google bans
accounts it sees on Code Assist through Antigravity's own client, the
built-in's way and the plugin's alike. The built-in's code is still in
the tree, but `googleLogins` lists nothing once the plugin serves it, so
it asks Google for nothing; the mover reads `googleSavedLogins`. The
plugin's 0.2.0 (the mover's min) sends nothing either: every request
gets a 410 "retired" naming Antigravity (local agy CLI),
`@magpie-community/opencode-agy-cli-auth`, which runs the user's own
agy over ACP, and it left the registry. Don't bring either route back.
The route's tests serve it again through
`provider.AntigravityBuiltinForTest()` until its code is taken out
(#6723).
The plugin does everything: sign-in, refresh, models, requests, usage and
errors. It runs in the plugin host (`internal/plugin`). The built-ins'
+1 -2
View File
@@ -168,7 +168,7 @@ An agent you're signed in to is a subscription with models behind it, so magpie
- **Claude**: drives the real local `claude` binary and bridges your agent's tools over MCP
- **Codex / ChatGPT**: your ChatGPT plan's models, in every other agent
- **GitHub Copilot**, **Gemini (Code Assist)**, **Antigravity**, **Grok (SuperGrok)** and more
- **GitHub Copilot**, **Gemini (Code Assist)**, **Antigravity** (through your own agy CLI), **Grok (SuperGrok)** and more
- **Any OpenCode auth plugin or pi package** from npm
**Daily warm-up** starts each Claude and ChatGPT account's 5-hour window at the times you choose, or the moment the last one resets.
@@ -213,7 +213,6 @@ A conversation **stays with the account that answered it** while the vendor's pr
```sh
magpie plugin add opencode-gemini-auth # an OpenCode plugin from npm
magpie plugin add pi-antigravity # a pi package, the same way
magpie plugin login google-plugin # its own sign-in flow, in magpie
```
+1 -2
View File
@@ -168,7 +168,7 @@ Agent 会把读到的东西放进提示词:一个 `.env`、一份配置、一
- **Claude**:驱动本机真正的 `claude` 程序,通过 MCP 桥接你的 Agent 的工具
- **Codex / ChatGPT**:你的 ChatGPT 订阅里的模型,给所有其他 Agent 用
- **GitHub Copilot**、**Gemini(Code Assist)**、**Antigravity**、**Grok(SuperGrok)** 等等
- **GitHub Copilot**、**Gemini(Code Assist)**、**Antigravity**(经你自己的 agy CLI)、**Grok(SuperGrok)** 等等
- **任何 OpenCode 登录插件或 pi 包**,直接从 npm 安装
**每日预热**会在你选定的时间,或者上一个窗口刚重置时,启动每个 Claude 和 ChatGPT 账号的 5 小时窗口。
@@ -213,7 +213,6 @@ Agent 会把读到的东西放进提示词:一个 `.env`、一份配置、一
```sh
magpie plugin add opencode-gemini-auth # npm 上的 OpenCode 插件
magpie plugin add pi-antigravity # pi 包,同样的方式
magpie plugin login google-plugin # 在 magpie 里走它自己的登录流程
```
+1 -1
View File
@@ -19,7 +19,7 @@ The `movers` map assembled in `internal/provider/migrate*.go` is the authoritati
`provider.Moved(id)` identifies a subscription whose migration state in `migrations.json` is `plugin`. In `/api/providers`, its row exposes `move.state == "plugin"`; the GUI also receives its id in `onPlugins`.
A retired built-in (`retiredBuiltins` in [`migrate.go`](../../internal/provider/migrate.go), `provider.BuiltinRetired(id)`) has no built-in code left: the plugin serves it whether or not a move has run, and its row's `move.state` is `plugin`. Gates that once asked `Moved(id)` ask `provider.PluginServes(id)`, which is moved or retired. Built-in accounts of a retired subscription that haven't moved yet are served by nothing; `/api/providers` lists them in `unmoved` (each a `MoveCandidate`, with the failed move's `error` and `why`), and the GUI shows a line over the Providers list with a Move button (`unmovedLine` in `app.js`). Built-ins are retired one at a time, each in the commit that removes its code.
A retired built-in (`retiredBuiltins` in [`migrate.go`](../../internal/provider/migrate.go), `provider.BuiltinRetired(id)`) has no built-in code left: the plugin serves it whether or not a move has run, and its row's `move.state` is `plugin`. Gates that once asked `Moved(id)` ask `provider.PluginServes(id)`, which is moved or retired. Built-in accounts of a retired subscription that haven't moved yet are served by nothing; `/api/providers` lists them in `unmoved` (each a `MoveCandidate`, with the failed move's `error` and `why`), and the GUI shows a line over the Providers list with a Move button (`unmovedLine` in `app.js`). Built-ins are retired one at a time, each in the commit that removes its code. Antigravity is the exception (11-15): retired before its code is removed, it is kept from Google by `googleLogins`, which lists no account of a subscription its plugin serves (the mover reads `googleSavedLogins`), and its plugin's 0.2.0 answers every request with a 410 that points to Antigravity (local agy CLI).
| Operation | Built-in owns the subscription | Plugin owns the subscription |
| --- | --- | --- |
+1
View File
@@ -60,6 +60,7 @@ func antigravityFile(t *testing.T, path string) map[string]json.RawMessage {
// model list come back when it is turned off, and what else the file holds
// is never touched.
func TestAntigravityGateway(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
home := antigravityHome(t)
path := filepath.Join(home, ".antigravity", "settings.json")
if !slices.ContainsFunc(All(), func(x *Agent) bool { return x.ID == "antigravity" && x.Name == "Antigravity" }) {
+1
View File
@@ -436,6 +436,7 @@ func ombSaves(t *testing.T, path string, engine json.RawMessage) {
// picked; no catalog change follows, so before KeepOpenMausBotListed
// nothing wrote magpie's list again.
func TestOpenMausBotListWrittenAgain(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
home := syncHome(t)
stashHome(t)
ombRelay(t)
+2
View File
@@ -1,6 +1,7 @@
package gateway
import (
"github.com/yetone/magpie/internal/provider"
"io"
"net/http"
"net/http/httptest"
@@ -26,6 +27,7 @@ func agyCLITurn(t *testing.T, s *Server, model string) (int, string) {
// quota is spent is passed over for the next, and the turn after asks the
// one with quota first, while agy itself stays on one model.
func TestAgyUsesEveryAntigravityAccount(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var asked []string
s, _ := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "m", func(w http.ResponseWriter, r *http.Request) {
who := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ")
@@ -22,6 +22,7 @@ import (
// as the variant at that level, told that level; with none picked they go
// as before, and another agent's requests never take its pick.
func TestAntigravityAgentEffort(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
fresh(t)
logins := []map[string]any{{
"agent": "antigravity", "user": "a@example.com", "on": true,
@@ -24,6 +24,7 @@ const arrayItems400 = `{"error":{"code":400,"message":"* GenerateContentRequest.
// takes (the reporter's table: {} and {"type":"string"} both answer 200);
// before, it went as it came and Google turned the whole turn away.
func TestAntigravityArrayGetsItems(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
r, err := parseAnthropic([]byte(arrayItemsAsk))
if err != nil {
t.Fatal(err)
@@ -48,6 +49,7 @@ func TestAntigravityArrayGetsItems(t *testing.T) {
// properties, items, an anyOf/oneOf member, an allOf, a $ref to $defs, a
// type list with null; one that has items keeps its own.
func TestPlainSchemaArraysAllHaveItems(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
in := `{"type":"object","$defs":{"Tags":{"type":"array","description":"tags"}},
"properties":{
"grid":{"type":"array","items":{"type":"array"}},
@@ -90,6 +92,7 @@ func TestPlainSchemaArraysAllHaveItems(t *testing.T) {
// that refused doesn't rest. Before, the route ended on the 400 (the
// reporter's tries held the one attempt).
func TestGroupFailsOverGoogleSchema400(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
fresh(t)
a := &scripted{replies: []reply{{400, "", arrayItems400}}}
b := &scripted{replies: []reply{{200, "", chatOK}}}
@@ -126,6 +126,7 @@ func unsaid(got string) string {
// SDK's line reworded, and the copy magpie sent until 11-14, which Google
// turned away 5 of 5 that day, goes the same way.
func TestAntigravityCloakClaudeCode2316(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
want := "You are a Claude agent, built on the Claude Agent SDK by Anthropic.\n"
for _, entry := range []string{"sdk-cli", "claude-desktop"} {
system := "x-anthropic-billing-header: cc_version=2.1.316.2e4; cc_entrypoint=" + entry + ";\nYou are a Claude agent, built on Anthropic's Claude Agent SDK.\n"
@@ -147,6 +148,7 @@ func TestAntigravityCloakClaudeCode2316(t *testing.T) {
}
func TestAntigravityCloakRewordsEveryLineItTurnsAway(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, system := range []string{
"You are a Claude agent, built on Anthropic's Claude Agent SDK.",
codexGPT5System,
@@ -208,6 +210,7 @@ func TestAntigravityCloakRewordsEveryLineItTurnsAway(t *testing.T) {
}
func TestAntigravityHermesHint(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
if antigravityHint(hermesOldSystem) != antigravityHermesHint {
t.Error("Hermes' old persona isn't told its own hint")
}
@@ -287,6 +290,7 @@ func codexAGPost(s *Server, body string) (int, string) {
// user can turn on, they are refused as before, told why at a status the
// agent doesn't retry.
func TestAntigravityAnswersHermesAndCodexByDefault(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var sent string
s, _ := antigravityGroupFor(t, []string{"u@example.com"}, "gemini-3-flash", fakeGoogle(&sent))
@@ -336,6 +340,7 @@ func TestAntigravityAnswersHermesAndCodexByDefault(t *testing.T) {
// CLI's own sign-in, on the same Code Assist envelope, and every other
// provider are sent the prompt as the agent wrote it.
func TestOnlyAntigravityIsSentThePromptReworded(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
r := &Request{System: hermesOldSystem + "\n" + codexGPT5System, Messages: []Message{{Role: "user", Parts: []Part{{Kind: Text, Text: "hi"}}}}}
gemini := provider.Provider{ID: "gemini-cli", Account: &provider.Account{Agent: "gemini"}}
if b := string(codeAssistBody(gemini, r, "gemini-3-flash", nil)); !strings.Contains(b, "You are Hermes Agent, an intelligent") || strings.Contains(b, `​`) || strings.Contains(b, zeroWidth) {
@@ -367,6 +372,7 @@ func TestOnlyAntigravityIsSentThePromptReworded(t *testing.T) {
// DeepSeek Harness's paragraph on @ paths goes to an Antigravity account
// reworded, and to every other provider as written (plugins#1028).
func TestAntigravityDSHAtPathsGoReworded(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
dsh := agReworded[0][0]
r := &Request{System: "You are DeepSeek Harness.\n\n" + dsh + "\n\nBe brief.", Messages: []Message{{Role: "user", Parts: []Part{{Kind: Text, Text: "hi"}}}}}
ag := provider.Provider{ID: "antigravity", Account: &provider.Account{Agent: "antigravity"}}
@@ -409,6 +415,7 @@ const ompLine = "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OP
// (eric_li8983 on X, 11-14): broken up by zero-width spaces it was
// turned away on a real account, worded so 0 in 10.
func TestAntigravityCloakOmpLine(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
got := antigravityCloak(ompSystem)
if want := strings.Replace(ompSystem, "keywords", "key words", 1); got != want {
t.Fatalf("went as %q, want %q", got, want)
@@ -426,6 +433,7 @@ func TestAntigravityCloakOmpLine(t *testing.T) {
// account on 11-14, and each goes reworded. A copy that only matched as
// written went out whole and was turned away.
func TestAntigravityCloakLineWrappedOrWidened(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
copies := []string{
strings.Replace(ompLine, "REQUIRED, ", "REQUIRED,\n", 1),
strings.Replace(ompLine, "REQUIRED, ", "REQUIRED,\r\n", 1),
@@ -479,6 +487,7 @@ func TestAntigravityCloakLineWrappedOrWidened(t *testing.T) {
// 429 (3 of 3 on a real account). The model's own turns, the caller's
// request and every other account keep it as written.
func TestAntigravityCloaksTheLineInAUsersTurn(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
said := "You were told: " + codexGPT5System
// the lines Google let through in a user's turn go as written there
others := "x-anthropic-billing-header: cc_version=2.1.316.2e4;\nYou are a Claude agent, built on Anthropic's Claude Agent SDK.\n" + hermesOldSystem + "\nRFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
@@ -2,6 +2,7 @@ package gateway
import (
"fmt"
"github.com/yetone/magpie/internal/provider"
"io"
"net/http"
"net/http/httptest"
@@ -19,6 +20,7 @@ const codexGPT5System = "You are Codex, an agent based on GPT-5. You and the use
// with the same 429 it gives Claude Code's prompt, in any case; the lines
// it answers were each tried on a real Antigravity account (10-27).
func TestAntigravityTurnsAwayCodexsGPT5Prompt(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, system := range []string{
codexGPT5System,
"You are Codex, a coding agent based on GPT-5. You and the user share the same workspace.",
@@ -79,6 +81,7 @@ func codexAGTurn(switched, search bool) string {
// Codex is told why at a status it doesn't retry, Antigravity is asked
// once, and the account doesn't rest.
func TestAntigravityTurnsCodexsGPT5ThreadAwayOnce(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, c := range []struct{ switched, search bool }{{false, false}, {true, false}, {false, true}, {true, true}} {
switched, search := c.switched, c.search
t.Run(fmt.Sprintf("switched=%v,search=%v", switched, search), func(t *testing.T) {
@@ -125,6 +128,7 @@ func TestAntigravityTurnsCodexsGPT5ThreadAwayOnce(t *testing.T) {
// In a group, the next Codex turn carrying that prompt skips Antigravity
// as Claude Code's does, and the skip says Codex's hint.
func TestAntigravityForeseesCodexsGPT5Prompt(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
asked := 0
s, _ := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
asked++
@@ -145,6 +149,7 @@ func TestAntigravityForeseesCodexsGPT5Prompt(t *testing.T) {
}
func TestAntigravityCodexHintIsTheRoutingPages(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
b, err := os.ReadFile(filepath.Join("..", "gui", "assets", "plugins", "routing", "client.js"))
if err != nil {
t.Fatal(err)
@@ -1,6 +1,7 @@
package gateway
import (
"github.com/yetone/magpie/internal/provider"
"testing"
"github.com/tidwall/gjson"
@@ -25,6 +26,7 @@ const displayItemsAsk = `{"model":"group/gemini-3-8-flash","max_tokens":32,"mess
// that has properties an object, whatever its enum or const says: typed
// from its values, the node went on with items on a string.
func TestGeminiToolTypesItemsBeforeEnum(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
out := geminiToolTypes([]byte(displayItemsAsk))
props := gjson.GetBytes(out, "tools.0.input_schema.properties")
if got := props.Get("display.type").String(); got != "array" {
@@ -45,6 +47,7 @@ func TestGeminiToolTypesItemsBeforeEnum(t *testing.T) {
// sent it, as this version's local magpie passes it on, and as a magpie
// from before passed it on (display typed "string").
func TestAntigravityItemsOnlyOnArrays(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
older := `{"model":"group/gemini-3-8-flash","max_tokens":32,"messages":[{"role":"user","content":"hi"}],
"tools":[{"name":"show","description":"show rows","input_schema":{"type":"object","properties":{
"display":{"type":"string","description":"columns to display","items":{"type":"string"},"enum":["name","size","date"]},
@@ -1,6 +1,7 @@
package gateway
import (
"github.com/yetone/magpie/internal/provider"
"io"
"net/http"
"net/http/httptest"
@@ -47,6 +48,7 @@ func drawOn(t *testing.T, s *Server) (int, string) {
// spent account while the next had its quota (01huadalang on Discord:
// several accounts, one's image quota spent, no move to the next).
func TestAntigravityDrawingOutOfQuotaInsideTheReplyGoesOn(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, asked := antigravityDrawers(t, func(w http.ResponseWriter) {
w.Header().Set("Content-Type", "text/event-stream")
io.WriteString(w, sse("data: "+antigravityQuota))
@@ -62,6 +64,7 @@ func TestAntigravityDrawingOutOfQuotaInsideTheReplyGoesOn(t *testing.T) {
// Any other error said inside the reply is no account's quota, and the
// drawing still ends there: the next account isn't asked, nothing rests.
func TestAntigravityDrawingOtherErrorInsideTheReplyStays(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, asked := antigravityDrawers(t, func(w http.ResponseWriter) {
w.Header().Set("Content-Type", "text/event-stream")
io.WriteString(w, sse(`data: {"error":{"code":500,"message":"Internal error encountered.","status":"INTERNAL"}}`))
@@ -82,6 +85,7 @@ func TestAntigravityDrawingOtherErrorInsideTheReplyStays(t *testing.T) {
// drawing asks the account that still has its quota first, where before
// every drawing asked the spent one again, and its text models stay in.
func TestAntigravityDrawingQuotaRestsTheImageModel(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, tc := range []struct {
name string
spent func(w http.ResponseWriter)
@@ -1,6 +1,7 @@
package gateway
import (
"github.com/yetone/magpie/internal/provider"
"io"
"net/http"
"net/http/httptest"
@@ -16,6 +17,7 @@ import (
// conversation (vhjjkkhg on X: 8 to 9 tries, 10+ minutes, from Alma on
// Responses). No account rests for it.
func TestEmptyReplyOnTwoAccountsEndsTheRequest(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
users := []string{"u1@example.com", "u2@example.com", "u3@example.com", "u4@example.com", "u5@example.com"}
for _, path := range []string{"/v1/responses", "/v1/chat/completions"} {
t.Run(path, func(t *testing.T) {
@@ -2,6 +2,7 @@ package gateway
import (
"encoding/json"
"github.com/yetone/magpie/internal/provider"
"strings"
"testing"
)
@@ -12,6 +13,7 @@ import (
// An enum of blanks alone, and a blank const, go without their enum; a
// number in an enum still drops it whole.
func TestPlainSchemaDropsBlankEnumValues(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
in := `{"type":"object","properties":{"StatusMessage":{"type":"object","properties":{"operationStatus":{"allOf":[{"enum":["processing","warning","error",""],"type":"string","x-enum-varnames":["EndpointOperationStatusProcessing","EndpointOperationStatusWarning","EndpointOperationStatusError","EndpointOperationStatusDone"]}],"description":"'', 'error', 'processing'","example":"error"}}},` +
`"blank":{"type":"string","enum":[""," "]},"c":{"type":"string","const":""},"n":{"enum":["a",1,""]}}}`
var got struct {
@@ -17,6 +17,7 @@ import (
// /v1/models?format=antigravity, is {"list": [...]} in the app's own
// fields, the models the key may use, each with its window and name.
func TestAntigravityCatalog(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
setup(t, provider.Anthropic, &fake{})
if err := provider.Save(provider.Provider{ID: "ds", Name: "DS", Key: "k", Chat: "http://127.0.0.1:1/v1", Models: []string{"big", "plain"}}); err != nil {
t.Fatal(err)
@@ -104,6 +105,7 @@ func TestAntigravityCatalog(t *testing.T) {
// level it has no word for is left out, and a model with one level left
// is listed once, as a menu of one is no choice (YujunT46308 on X).
func TestAntigravityLevels(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, c := range []struct {
in, want []string
}{
@@ -123,6 +125,7 @@ func TestAntigravityLevels(t *testing.T) {
// level asked, fitted to the model's, else at medium, as the app's own
// picker starts one, else its weakest; a model with no levels as it is.
func TestAntigravityModelStartsOnALevel(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
setup(t, provider.Anthropic, &fake{})
if err := provider.Save(provider.Provider{ID: "ds", Name: "DS", Key: "k", Chat: "http://127.0.0.1:1/v1", Models: []string{"three", "two", "plain"}}); err != nil {
t.Fatal(err)
@@ -18,6 +18,7 @@ import (
// Discovery and routing agree when a new model is available only to a
// secondary account, including the family id clients actually request.
func TestAntigravityPoolRoutesDiscoveredModels(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
fresh(t)
var logins []map[string]any
for _, user := range []string{"old", "new"} {
+13
View File
@@ -131,6 +131,7 @@ func turnOn(t *testing.T, s *Server, body string) (int, string) {
// an hour for a request it refused, its usage isn't asked again, and the
// next turn asks it first again — as the refusal it is, not a spent quota.
func TestAntigravityTurnedAwayRestsNobody(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, askedUsage := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
io.WriteString(w, turnedAway)
@@ -170,6 +171,7 @@ func TestAntigravityTurnedAwayRestsNobody(t *testing.T) {
// as before), and once the last refusal is old, it is asked again, so a
// block Google lifts is noticed.
func TestAntigravityTurnedAwayIsForeseen(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
asked := 0
s, askedUsage := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
asked++
@@ -225,6 +227,7 @@ func TestAntigravityTurnedAwayIsForeseen(t *testing.T) {
// A 429 that really is the plan used up — no such system prompt asking —
// still rests the account, as it did (#147, #530).
func TestAntigravityQuotaStillRests(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, askedUsage := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
io.WriteString(w, turnedAway)
@@ -252,6 +255,7 @@ func TestAntigravityQuotaStillRests(t *testing.T) {
// no excuse for an account that really is broken, overloaded or denied: it
// rests as it would on any other request (the maintenance review of #873).
func TestAntigravityTurnedAwayIsOnlyTheRefusal(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, tc := range []struct {
name string
status int
@@ -286,6 +290,7 @@ func TestAntigravityTurnedAwayIsOnlyTheRefusal(t *testing.T) {
// ledger keeps it: a Claude Code turn's 429 is as visible as any other
// failed call (the maintenance review of #873).
func TestAntigravityTurnedAwayStillLandsInTheLedger(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, _ := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
io.WriteString(w, turnedAway)
@@ -310,6 +315,7 @@ func TestAntigravityTurnedAwayStillLandsInTheLedger(t *testing.T) {
// a round-trip apiece before the group reaches the member that answers
// (the maintenance review of #873).
func TestAntigravityTurnedAwayLeavesItsMatesForLast(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, _ := antigravityTurnedAwayGroup(t, []string{"u@example.com", "v@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
io.WriteString(w, turnedAway)
@@ -336,6 +342,7 @@ func TestAntigravityTurnedAwayLeavesItsMatesForLast(t *testing.T) {
// It leaves the account alone as the 429 does, and an error event of any
// other kind still rests it.
func TestAntigravityTurnedAwaySaidInsideTheReply(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, tc := range []struct {
name string
body string
@@ -398,6 +405,7 @@ func directTurn(system string, stream bool) string {
// page tells it as the agent's prompt turned away, not a quota used up; the
// account doesn't rest and isn't asked again.
func TestAntigravityTurnedAwayLastIsNoQuota(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, stream := range []bool{false, true} {
t.Run(fmt.Sprintf("stream=%v", stream), func(t *testing.T) {
asked := 0
@@ -441,6 +449,7 @@ func TestAntigravityTurnedAwayLastIsNoQuota(t *testing.T) {
// event), with nobody left: told the same, at a status not retried, and not
// asked again as a failure that may pass.
func TestAntigravityTurnedAwayInsideTheReplyLast(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
asked := 0
s, _ := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
asked++
@@ -463,6 +472,7 @@ func TestAntigravityTurnedAwayInsideTheReplyLast(t *testing.T) {
// is told what Antigravity turned away and why, at a status it doesn't
// retry — not the other's quota, which waiting wouldn't fix either.
func TestAntigravityTurnedAwayThenAQuota(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, _ := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
io.WriteString(w, turnedAway)
@@ -491,6 +501,7 @@ func TestAntigravityTurnedAwayThenAQuota(t *testing.T) {
// nobody left the agent gets the 429 (Rest-of-#666 review: refusal, account
// or model, told apart by what was said, not by the system prompt alone).
func TestAntigravityQuotaOnAClaudeCodeTurnStaysQuota(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
t.Run("in a group", func(t *testing.T) {
s, askedUsage := antigravityTurnedAwayGroup(t, []string{"u@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
@@ -528,6 +539,7 @@ func TestAntigravityQuotaOnAClaudeCodeTurnStaysQuota(t *testing.T) {
// The Routing page says the note apart from Antigravity's words, in its own
// language, only when it knows the very words the gateway adds.
func TestAntigravityTurnedAwayHintIsTheRoutingPages(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
b, err := os.ReadFile(filepath.Join("..", "gui", "assets", "plugins", "routing", "client.js"))
if err != nil {
t.Fatal(err)
@@ -544,6 +556,7 @@ func TestAntigravityTurnedAwayHintIsTheRoutingPages(t *testing.T) {
// while the next ticked one had all its quota left (Dani Ariyanto on
// Discord, 10-24: OpenCode on Gemini 3.8 Flash, seven accounts).
func TestAntigravityQuotaRestsUntilItsReset(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var asked []string
s, _ := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
who := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ")
@@ -2,6 +2,7 @@ package gateway
import (
"encoding/json"
"github.com/yetone/magpie/internal/provider"
"reflect"
"testing"
@@ -18,6 +19,7 @@ const rgSchema = `{"type":"object","properties":{"pattern":{"type":"string"},"cu
// {"type":"string"} and Claude there answered 400 "tools.4.custom.
// input_schema.type: Input should be 'object'".
func TestAntigravityRootOneOfKeepsObject(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
got := plainSchema(json.RawMessage(rgSchema))
var parameters map[string]any
if err := json.Unmarshal(got, &parameters); err != nil {
@@ -32,6 +34,7 @@ func TestAntigravityRootOneOfKeepsObject(t *testing.T) {
// The same tool through the route the reporter took: an OpenAI Chat
// declaration, parseChat, then the Antigravity body.
func TestAntigravityChatToolRootOneOfKeepsObject(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
r, err := parseChat([]byte(`{"model":"m","messages":[{"role":"user","content":"hi"}],"tools":[{"type":"function","function":{"name":"rg","description":"search","parameters":` + rgSchema + `}}]}`))
if err != nil {
t.Fatal(err)
@@ -53,6 +56,7 @@ func TestAntigravityChatToolRootOneOfKeepsObject(t *testing.T) {
// member does; a null branch makes it nullable. A union with nothing of
// its own beside it is still read as its first branch that isn't null.
func TestPlainSchemaUnionKeepsOwnShape(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, c := range []struct{ name, in, want string }{
{"root oneOf", rgSchema,
`{"type":"object","properties":{"pattern":{"type":"string"},"cursor":{"type":"string"}}}`},
@@ -98,6 +102,7 @@ func TestPlainSchemaUnionKeepsOwnShape(t *testing.T) {
// the upstreams that refuse a root union), keeps the same tool an object
// with both its fields: its constraint-only branches are passed over.
func TestObjectSchemaRootOneOfKeepsObject(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
ps := gjson.ParseBytes(objectSchema(json.RawMessage(rgSchema)))
if ps.Get("type").String() != "object" || !ps.Get("properties.pattern").Exists() || !ps.Get("properties.cursor").Exists() || ps.Get("oneOf").Exists() || ps.Get("required").Exists() {
t.Fatalf("got %s", ps.Raw)
@@ -26,6 +26,7 @@ const antigravitySuspended = `{"error":{"code":403,"message":"This service has b
// unknown failure that doubled to ten and had it asked, and refused, every
// ten minutes for good.
func TestAntigravitySuspendedRestsAsRestricted(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var asked []string
s, askedUsage := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
who := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ")
@@ -75,6 +76,7 @@ func TestAntigravitySuspendedRestsAsRestricted(t *testing.T) {
// Google's own words; lifted on the Routing page (an appeal went through),
// it is asked again.
func TestAntigravitySuspendedAloneRests(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
n, back := 0, false
s, _ := antigravityGroupFor(t, []string{"u1@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
n++
@@ -111,6 +113,7 @@ func TestAntigravitySuspendedAloneRests(t *testing.T) {
// a Google plugin's: another 403 from Antigravity, and the same words from a
// key's relay or another plugin, fail as before.
func TestAntigravitySuspendedIsGooglesAlone(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
ag := candidate{p: provider.Provider{ID: "antigravity", Account: &provider.Account{Agent: "antigravity", User: "u"}}}
gem := candidate{p: provider.Provider{ID: "gemini", Account: &provider.Account{Agent: "gemini", User: "u"}}}
key := candidate{p: provider.Provider{ID: "relay", Key: "k"}}
@@ -111,6 +111,7 @@ const codeAssistNotFound = `{"error":{"code":404,"message":"Requested entity was
// Gemini 4 on one Antigravity account of several). The Routing page has
// it asked, not "unlisted, skipped", and the first rests for that model.
func TestUnlistedAccountAskedAfterModelRefused(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
s, turn, asked := unlistedArgon(t, map[string]string{
"a@example.com": `{"models":{"gemini-3.8-flash":{},"gemini-4-argon":{"displayName":"Gemini 4 Argon"}}}`,
"b@example.com": `{"models":{"gemini-3.8-flash":{}}}`,
@@ -142,6 +143,7 @@ func TestUnlistedAccountAskedAfterModelRefused(t *testing.T) {
// bodies) leaves the accounts whose list lacks it alone, as before: they
// would only refuse it too.
func TestUnlistedAccountNotAskedForOtherRefusals(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, c := range []struct {
name, body string
code int
@@ -168,6 +170,7 @@ func TestUnlistedAccountNotAskedForOtherRefusals(t *testing.T) {
// A gateway key held to some accounts (#905) isn't given an unlisted
// account it may not use: the refusal reaches its agent, as before.
func TestUnlistedAccountHeldFromKey(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
_, turn, asked := unlistedArgon(t, map[string]string{
"a@example.com": `{"models":{"gemini-3.8-flash":{},"gemini-4-argon":{"displayName":"Gemini 4 Argon"}}}`,
"b@example.com": `{"models":{"gemini-3.8-flash":{}}}`,
@@ -187,6 +190,7 @@ func TestUnlistedAccountHeldFromKey(t *testing.T) {
// The unlisted account is asked before the provider's Fallback: it is the
// same model on the same subscription, which the fallback is not.
func TestUnlistedAccountBeforeFallback(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
_, turn, asked := unlistedArgon(t, map[string]string{
"a@example.com": `{"models":{"gemini-3.8-flash":{},"gemini-4-argon":{"displayName":"Gemini 4 Argon"}}}`,
"b@example.com": `{"models":{"gemini-3.8-flash":{}}}`,
@@ -14,6 +14,7 @@ import (
// only it rests on that account; the account itself doesn't, and its
// other models are asked as before.
func TestCodeAssistMissingModelRestsTheModel(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
const notFound = `{"error":{"code":404,"message":"Requested entity was not found.","status":"NOT_FOUND"}}`
s, _ := antigravityGroupFor(t, []string{"u@example.com"}, "argon", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
@@ -142,6 +142,7 @@ func TestLateRestsEmptyReply(t *testing.T) {
// the accounts must not be put into rest backoff, and the routing group must
// fall over to another member to answer (#1221).
func TestGeminiEmptyReplyGroupFailover(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, stream := range []bool{true, false} {
t.Run(map[bool]string{true: "stream", false: "nostream"}[stream], func(t *testing.T) {
s, _ := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
@@ -163,6 +163,7 @@ func TestGeminiImageConfigReachesTheGeminiAPI(t *testing.T) {
// envelope: Antigravity is asked as a Gemini API is, its request a Gemini
// request.
func TestGeminiImageConfigReachesCodeAssist(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
rec := &asksKept{}
s, _ := antigravityGroupFor(t, []string{"u@example.com"}, agDrawer, func(w http.ResponseWriter, r *http.Request) {
rec.keep(r)
@@ -82,6 +82,7 @@ func TestImagesAPISizeReachesTheGeminiAPI(t *testing.T) {
// (TestGeminiImageConfigReachesCodeAssist), inside Code Assist's envelope
// too. None asked, none sent, as before.
func TestImagesAPISizeReachesCodeAssist(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
rec := &asksKept{}
s, _ := antigravityGroupFor(t, []string{"u@example.com"}, agDrawer, func(w http.ResponseWriter, r *http.Request) {
rec.keep(r)
+5
View File
@@ -5,6 +5,7 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"github.com/yetone/magpie/internal/provider"
"io"
"net"
"net/http"
@@ -170,6 +171,7 @@ func antigravityOnEdge(t *testing.T, users []string, v *edgeVendor) *Server {
// 400, while a new connection was answered. The next account now goes out
// on a new connection and answers, and the account refused rests not.
func TestAntigravityRegionRefusalAsksTheNextOnANewConnection(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
v := newEdgeVendor(t, true, googleRegion400)
s := antigravityOnEdge(t, []string{"u1@example.com", "u2@example.com"}, v)
code, out := turnOn(t, s, directTurn("You are a helpful assistant.", false))
@@ -200,6 +202,7 @@ func TestAntigravityRegionRefusalAsksTheNextOnANewConnection(t *testing.T) {
// #5182: the only account, refused for where the request came from, is
// asked again a moment later, on a new connection, and answers.
func TestAntigravityRegionRefusalAsksTheLastAgain(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
pause := retryPause
retryPause = time.Millisecond
t.Cleanup(func() { retryPause = pause })
@@ -222,6 +225,7 @@ func TestAntigravityRegionRefusalAsksTheLastAgain(t *testing.T) {
// (restAfter), and counts no failure: the account is asked first again.
// A 500 on the same account still rests it as before.
func TestRegionRefusalRestsNoAccount(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for _, body := range []string{googleRegion400, antigravityRegion400} {
s, askedUsage := antigravityTurnedAwayGroup(t, []string{"u1@example.com", "u2@example.com"}, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
@@ -272,6 +276,7 @@ func TestRegionRefusalRestsNoAccount(t *testing.T) {
// nobody rests, and the agent is told Google's regional restriction on
// the model, at the 400 it doesn't retry.
func TestRegionRefusalOfTheModelEndsAfterOneMoreAsk(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
pause := retryPause
retryPause = time.Millisecond
t.Cleanup(func() { retryPause = pause })
+3
View File
@@ -26,6 +26,7 @@ func agyTurn(s *Server) (int, string) {
// suspended Antigravity accounts, 23 and 22 tries, none answered). Lifted
// on the Routing page, the account is asked again.
func TestSuspendedAccountsNotAskedWhileTheyRest(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var asked []string
s, _ := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
asked = append(asked, strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer "))
@@ -86,6 +87,7 @@ func TestRestrictedLoneAccountNotAskedWhileItRests(t *testing.T) {
// A refusal of the request's content is not the account's: it rests
// nobody, and the next request asks the same account again.
func TestContentRefusalStillAsksTheAccount(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
n := 0
s, _ := antigravityGroupFor(t, []string{"u1@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
n++
@@ -108,6 +110,7 @@ func TestContentRefusalStillAsksTheAccount(t *testing.T) {
// the account's rest isn't taken anew by each such turn: it ends when it
// would, rather than never while the conversation goes on.
func TestSuspendedStrictConversationKeepsItsRest(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
var asked []string
suspended := false
s, _ := antigravityGroupFor(t, []string{"u1@example.com", "u2@example.com"}, "gemini-3.8-flash", func(w http.ResponseWriter, r *http.Request) {
+1
View File
@@ -117,6 +117,7 @@ func TestBareErrorsHoldsNothingElse(t *testing.T) {
// that "ended before it was complete". It is the request's fault: the
// account doesn't rest, and the route books the 400.
func TestAntigravityBareErrorIsTheVendors(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
for name, reply := range agBareEnds {
for _, stream := range []bool{true, false} {
t.Run(fmt.Sprintf("%s/stream=%v", name, stream), func(t *testing.T) {
@@ -21,6 +21,7 @@ import (
// "hi" built by the translator in the account's envelope, and says what
// the vendor answered — a word, or its refusal.
func TestAntigravityModelTest(t *testing.T) {
t.Cleanup(provider.AntigravityBuiltinForTest()) // the retired built-in route
fresh(t)
dir := filepath.Dir(provider.Path())
if err := os.MkdirAll(dir, 0o700); err != nil {
+1
View File
@@ -86,6 +86,7 @@ func loginRoutingUsers(p *Provider) []string {
}
func TestAccountOrderSideLoginsAllRoutingModes(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
users := []string{"a@example.test", "b@example.test", "c@example.test", "off@example.test"}
for _, user := range users {
@@ -31,6 +31,7 @@ var antigravityListed = []catalog.Model{
// those levels; a model with one id, or only a name like another's,
// stays as Antigravity lists it.
func TestCollapseAntigravityModels(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
var got []string
for _, m := range collapseAntigravityModels(antigravityListed) {
got = append(got, m.ID+"|"+m.Name+"|"+strings.Join(m.Efforts, ","))
@@ -92,6 +93,7 @@ func TestCollapseAntigravityModels(t *testing.T) {
// ids: each is the model magpie offers for it now, once, where it was;
// the rest stay.
func TestAntigravityLegacyPicks(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
home := t.TempDir()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
@@ -134,6 +136,7 @@ func TestAntigravityLegacyPicks(t *testing.T) {
// id its model's with "(Tiered)" (EZN7L2C3, #955: agy's list showed
// magpie/antigravity/gemini-3.6-flash-tiered), any other its id.
func TestAntigravityUnnamedModels(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
raw := []catalog.Model{
{ID: "gemini-3.6-flash-high", Name: "Gemini 3.6 Flash (High)"},
{ID: "gemini-3.6-flash-low", Name: "Gemini 3.6 Flash (Low)"},
@@ -12,6 +12,7 @@ import (
// A rollout can give the first account 4.6 and another enabled account
// 5.5. Refresh must discover both, and routing must know who lists each.
func TestAntigravityModelsAcrossAccounts(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
replies := map[string]string{
"project-old": `{"models":{"gemini-3.8-flash":{},"claude-opus-4-6-thinking":{"displayName":"Claude Opus 4.6 (Thinking)"},"gpt-oss-120b-medium":{}},
"agentModelSorts":[{"groups":[{"modelIds":["gemini-3.8-flash","claude-opus-4-6-thinking","gpt-oss-120b-medium"]}]}]}`,
@@ -120,6 +121,7 @@ func TestAntigravityModelsAcrossAccounts(t *testing.T) {
// The merge keeps each account's own order: a model only a later account
// has goes right after the model before it in that account's list.
func TestMergeAntigravityOrder(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
ids := func(ss ...string) []catalog.Model {
var out []catalog.Model
for _, s := range ss {
@@ -17,6 +17,7 @@ import (
// account made preferred is needed for the picker, routing or its bar.
// An account switched off changes nothing.
func TestAntigravityQuotaReadingListsNewModels(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
replies := map[string]string{
"project-a": `{"models":{"gemini-3.8-flash":{"quotaInfo":{"remainingFraction":1}},"gemini-4-argon-disabled":{"displayName":"Gemini 4 Argon","disabled":true}}}`,
"project-b": `{"models":{"gemini-3.8-flash":{"quotaInfo":{"remainingFraction":1}}}}`,
@@ -8,6 +8,7 @@ import (
// Routing sees the same model family the picker offers, including when
// quota is read before the live model catalog has been saved.
func TestAntigravityQuotaRoutesBaseModel(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"cloudaicompanionProject":"test-project"}`,
models: `{"models":{
@@ -0,0 +1,57 @@
package provider
import (
"context"
"testing"
"time"
)
// Antigravity's built-in is retired (11-15): Google bans accounts it sees
// on Code Assist through Antigravity's client. A saved account is still
// read by its mover, but nothing lists, reads usage for or asks Google
// with it, while Gemini CLI's accounts, on the same code, are untouched.
func TestRetiredAntigravityAsksGoogleNothing(t *testing.T) {
f := &fakeGoogle{quota: `{"buckets":[]}`, models: `{"models":{}}`}
googleSandbox(t, f)
exp := time.Now().Add(time.Hour).UnixMilli()
if err := addGoogleLogin("antigravity", "ag@example.com", "", googleAuth{AccessToken: "at-ag", RefreshToken: "rt-ag", Project: "proj-ag", Expiry: exp}); err != nil {
t.Fatal(err)
}
ForgetAccounts()
if !PluginServes("antigravity") {
t.Fatal("antigravity's built-in is not retired")
}
if ls := googleLogins("antigravity"); len(ls) != 0 {
t.Fatalf("googleLogins(antigravity) = %d accounts, want none: the built-in serves nothing", len(ls))
}
if _, ok := googleAccountOf("antigravity"); ok {
t.Fatal("googleAccountOf(antigravity) gave an account")
}
if ls := googleSavedLogins("antigravity"); len(ls) != 1 || ls[0].User != "ag@example.com" {
t.Fatalf("googleSavedLogins(antigravity) = %+v, want the saved account for its mover", ls)
}
if ms := movingOf(t, "antigravity"); len(ms) != 1 {
t.Fatalf("the mover carries %d accounts, want 1: %+v", len(ms), ms)
}
for _, q := range fetchSubscriptionUsage(context.Background()) {
if q.Provider == "antigravity" {
t.Fatalf("usage has an Antigravity card: %+v", q)
}
}
f.mu.Lock()
asked := len(f.heads)
f.mu.Unlock()
if asked != 0 {
t.Fatalf("Google was asked %d times with only an Antigravity account saved", asked)
}
// Gemini CLI's accounts, on the same code, are served as before
if err := addGoogleLogin("gemini", "g@example.com", "", googleAuth{AccessToken: "at-g", RefreshToken: "rt-g", Project: "proj-g", Expiry: exp}); err != nil {
t.Fatal(err)
}
ForgetAccounts()
if ls := googleLogins("gemini"); len(ls) != 1 {
t.Fatalf("googleLogins(gemini) = %d accounts, want 1", len(ls))
}
}
@@ -81,6 +81,7 @@ func antigravityModelIDs(t *testing.T, agent string) []string {
// in entitlement.userTier, as Antigravity's language server does, and the
// log says what Google answered and what magpie left out.
func TestAntigravityProAccountNamesItsTier(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{load: proLoad, modelsFor: tierModels("g1-pro-tier")}
googleSandbox(t, f)
buf := captureLog(t)
@@ -109,6 +110,7 @@ func TestAntigravityProAccountNamesItsTier(t *testing.T) {
// A tier Google won't take from the account is left out: the next is
// tried, then none, and the refusal is logged.
func TestAntigravityTierRefusedFallsBack(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{load: proLoad, modelsFor: tierModels("standard-tier")}
googleSandbox(t, f)
buf := captureLog(t)
@@ -143,6 +145,7 @@ func TestAntigravityTierRefusedFallsBack(t *testing.T) {
// before; one whose project was kept with its sign-in still has its tiers
// asked for, so a Pro account imported with its project names its plan.
func TestAntigravityTierFreeAndKeptProject(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"currentTier":{"id":"free-tier","name":"Antigravity"},"paidTier":{"id":"free-tier","name":"Antigravity Starter Quota"},"cloudaicompanionProject":"aicode-consumers"}`,
modelsFor: tierModels("g1-pro-tier"),
@@ -176,6 +179,7 @@ func TestAntigravityTierFreeAndKeptProject(t *testing.T) {
// left out of the list for every client; the models beside it, and their
// ids, are as Google sent them.
func TestAntigravityDisabledModelLeftOut(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{load: `{"currentTier":{"id":"free-tier","name":"Antigravity"},"cloudaicompanionProject":"aicode-consumers"}`, models: `{"models":{
"gemini-3.8-flash-high":{"displayName":"Gemini 3.8 Flash (High)","maxTokens":1048576,"quotaInfo":{"remainingFraction":1}},
"gemini-4-argon-disabled":{"displayName":"Gemini 4 Argon","maxTokens":1048576,"disabled":true,"quotaInfo":{"remainingFraction":1}},
@@ -203,6 +207,7 @@ func TestAntigravityDisabledModelLeftOut(t *testing.T) {
// sub2api, Antigravity-Manager), and lists what that gives. Should that
// fail too, the log says so and the account keeps the list it had.
func TestAntigravityProInvalidTierAsksWithoutOne(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
const load = `{"currentTier":{"id":"free-tier","name":"Antigravity"},
"paidTier":{"id":"g1-pro-tier","name":"Google AI Pro"},
"cloudaicompanionProject":"aicode-consumers"}`
@@ -275,6 +280,7 @@ func TestAntigravityProInvalidTierAsksWithoutOne(t *testing.T) {
// a step no row is written for, it isn't named again for tierRefusedFor,
// and a list that fails without one is still written down.
func TestAntigravityRefusedTierAskedOnceAndNoRow(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
const load = `{"currentTier":{"id":"free-tier","name":"Antigravity"},
"paidTier":{"id":"g1-pro-tier","name":"Google AI Pro"},
"cloudaicompanionProject":"aicode-consumers"}`
@@ -363,6 +369,7 @@ func TestAntigravityRefusedTierAskedOnceAndNoRow(t *testing.T) {
// A tier refused for a reason other than a 400 (Google down) is named
// again on the next list.
func TestAntigravityTierNotRestedForOtherFailures(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{load: proLoad, modelsFor: func(body map[string]any) (int, string) {
if body["entitlement"] != nil {
return 503, `{"error":{"code":503,"message":"The service is currently unavailable.","status":"UNAVAILABLE"}}`
@@ -391,6 +398,7 @@ func TestAntigravityTierNotRestedForOtherFailures(t *testing.T) {
// Now they are asked again once an hour old, as Gemini CLI's experiments
// are, and a list names the tier the account has now.
func TestAntigravityTierAskedAgainAfterUpgrade(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
const free = `{"currentTier":{"id":"free-tier","name":"Antigravity"},"cloudaicompanionProject":"aicode-consumers"}`
const ultra = `{"currentTier":{"id":"standard-tier","name":"Antigravity","usesGcpTos":true},
"paidTier":{"id":"g1-ultra-tier","name":"Google AI Ultra"},"cloudaicompanionProject":"aicode-consumers"}`
+1
View File
@@ -24,6 +24,7 @@ import (
// every list Codex and the ChatGPT app are handed; one whose base magpie
// doesn't know still takes none, and a vendor's own word stays its own.
func TestCPAVariantModelsBorrowLevels(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
home := t.TempDir()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
+1
View File
@@ -16,6 +16,7 @@ import (
// part of a model's own name (-max, mistral-medium) is not taken for an
// effort of another model.
func TestEffortIDPricedAsItsModel(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
home := t.TempDir()
t.Setenv("HOME", home)
t.Setenv("USERPROFILE", home)
+2
View File
@@ -6,6 +6,7 @@ import "testing"
// providers only: every other provider's, each account's and plugin's,
// was built on each usage read for nothing.
func TestExposedIDsBuildsOnlyTheProvidersAsked(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
isolate(t)
for _, p := range []Provider{
{ID: "asked", Name: "Asked", Key: "k", Chat: "http://127.0.0.1:1/v1", Models: []string{"gemini-a"}},
@@ -28,6 +29,7 @@ func TestExposedIDsBuildsOnlyTheProvidersAsked(t *testing.T) {
// providers whose quotas are narrowed are built once while nothing changes, so the catalog they
// load can be let go, and again after a change, which reaches the answer.
func TestKeptExposedIDsBuiltOncePerChange(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
isolate(t)
keptExposed.Lock()
keptExposed.ids = nil
+1
View File
@@ -12,6 +12,7 @@ import (
// Discord: `magpie provider refresh antigravity` found no Antigravity, which
// the window showed signed in); without the variable it says nothing more.
func TestFindSaysFilesAreElsewhere(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
h := t.TempDir()
t.Setenv("HOME", h)
t.Setenv("USERPROFILE", h)
+1
View File
@@ -12,6 +12,7 @@ import (
// ticked off it hands first to the next ticked account; with no other
// ticked, it stays, as one account is always used.
func TestFirstTickedOffHandsFirstOn(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
claudeHome(t)
auth := func(r string) json.RawMessage {
b, _ := json.Marshal(googleAuth{RefreshToken: r})
@@ -11,6 +11,7 @@ import (
// other account to put first. The only one goes; with another there, the
// first still waits for it to be put first.
func TestForgetOnlyFirstLogin(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
claudeHome(t)
auth := func(r string) json.RawMessage {
b, _ := json.Marshal(googleAuth{RefreshToken: r})
+12 -1
View File
@@ -227,8 +227,19 @@ type googleLogin struct {
acct googleAccount
}
// googleLogins lists an app's accounts, the first in use first.
// googleLogins lists an app's accounts the built-in serves, the first in
// use first: none for one its plugin serves (Antigravity, retired), so
// nothing here asks Google for its models, usage or requests.
func googleLogins(agent string) []googleLogin {
if PluginServes(agent) {
return nil
}
return googleSavedLogins(agent)
}
// googleSavedLogins lists an app's saved accounts, the first in use first,
// served or not: its mover reads them to carry them over.
func googleSavedLogins(agent string) []googleLogin {
own, hasOwn := googleAccount{}, false
if agent == "gemini" {
own, hasOwn = geminiOwnLogin()
+2
View File
@@ -14,6 +14,7 @@ import (
)
func TestParseGoogleImportFormats(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
cases := []struct {
name, data string
want []googleImport // n and err not compared unless set
@@ -118,6 +119,7 @@ func (f *fakeGoogleImport) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
func TestImportGoogleAccounts(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
f := &fakeGoogleImport{users: map[string]string{"1//a": "a@x.com", "1//b": "b@x.com", "1//c": "c@x.com", "1//n": "nouser"}}
srv := httptest.NewServer(f)
+11
View File
@@ -161,6 +161,7 @@ func TestGeminiOwnLoginRefreshesInMemory(t *testing.T) {
// minted for another client (Antigravity's) can't be refreshed as Gemini
// CLI's and isn't listed; one without an ID token is taken as Gemini CLI's.
func TestGeminiOwnLoginOnlyGeminiCLIsClient(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
idToken := func(claims map[string]any) string {
b, _ := json.Marshal(claims)
return "e30." + base64.RawURLEncoding.EncodeToString(b) + ".sig"
@@ -268,6 +269,7 @@ func TestSetGoogleProject(t *testing.T) {
// roll it out to the account, previews where its quota has one — and each
// goes to Code Assist by the id the CLI sends.
func TestGeminiModelsAsTheCLIOffersThem(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
ids := func(ms []catalog.Model) string {
var s []string
for _, m := range ms {
@@ -355,6 +357,7 @@ func TestGeminiModelsAsTheCLIOffersThem(t *testing.T) {
// Antigravity's account is onboarded on the daily endpoint, asking until
// it is done, and its requests carry what Antigravity sends.
func TestAntigravityProjectAndEnvelope(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"allowedTiers":[{"id":"free-tier","name":"Antigravity","isDefault":true}]}`,
onboard: `{"done":true,"response":{"cloudaicompanionProject":"ag-proj"}}`,
@@ -409,6 +412,7 @@ func TestAntigravityProjectAndEnvelope(t *testing.T) {
// read as bloat), so the GUI can show one figure a family; the windows
// themselves, and the model each counts for routing, stay as they were.
func TestAntigravityQuotaFamilies(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"allowedTiers":[{"id":"free-tier","name":"Antigravity","isDefault":true}]}`,
onboard: `{"done":true,"response":{"cloudaicompanionProject":"ag-proj"}}`,
@@ -462,6 +466,7 @@ func TestAntigravityQuotaFamilies(t *testing.T) {
// after the models', each model naming its group, and a page of text shows
// the groups' windows in place of the models'.
func TestAntigravityQuotaPools(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"allowedTiers":[{"id":"free-tier","name":"Antigravity","isDefault":true}]}`,
onboard: `{"done":true,"response":{"cloudaicompanionProject":"ag-proj"}}`,
@@ -608,6 +613,7 @@ func TestPooledWindowsPartialAggregateKeepsModelFallback(t *testing.T) {
// model it adds isn't given those of a model of that name elsewhere
// (Anthropic's 1M for Claude), nor said to see when it doesn't.
func TestAntigravityModelsAsItListsThem(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"allowedTiers":[{"id":"free-tier","name":"Antigravity","isDefault":true}]}`,
onboard: `{"done":true,"response":{"cloudaicompanionProject":"ag-proj"}}`,
@@ -661,6 +667,7 @@ func TestAntigravityModelsAsItListsThem(t *testing.T) {
// list and in Usage's windows, so no two read the same; a level tagged
// with its own family keeps the name it was given.
func TestAntigravityRetiredModelNamedForItself(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
f := &fakeGoogle{
load: `{"allowedTiers":[{"id":"free-tier","name":"Antigravity","isDefault":true}]}`,
onboard: `{"done":true,"response":{"cloudaicompanionProject":"ag-proj"}}`,
@@ -747,6 +754,7 @@ func TestAntigravityRetiredModelNamedForItself(t *testing.T) {
// name does; no two models read the same, and the names Antigravity gives
// the rest stay.
func TestAntigravityRetiredModelNamedWithoutTag(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
raw, err := os.ReadFile("testdata/antigravity-models-2026-10-20.json")
if err != nil {
t.Fatal(err)
@@ -831,6 +839,7 @@ func TestAntigravityRetiredModelNamedWithoutTag(t *testing.T) {
// models, whichever Google lists first and whether or not it has 5 hours
// (01huadalang on Discord: a Gemini 4 bar of 7 days, and Claude's gone).
func TestAntigravityQuotaModelGroup(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
argon := func(five bool) string {
b := `{"bucketId":"gemini-argon-wtu-weekly","window":"weekly","remainingFraction":0.53,"resetTime":"2099-01-07T00:00:00Z","displayName":"Gemini 4 Argon Weekly Limit"}`
if five {
@@ -903,6 +912,7 @@ func TestAntigravityQuotaModelGroup(t *testing.T) {
// names it; one read alike folds, as before; with the group in the
// summary, the group's (TestAntigravityQuotaModelGroup).
func TestAntigravityQuotaModelApartFromGroup(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
at := func(d time.Duration) string { return time.Now().Add(d).UTC().Format(time.RFC3339) }
five, week := at(3*time.Hour), at(6*24*time.Hour)
gemini := `{"displayName":"Gemini Models","description":"Models within this group: Gemini Flash, Gemini Pro","buckets":[
@@ -987,6 +997,7 @@ func TestAntigravityQuotaModelApartFromGroup(t *testing.T) {
// "Gemini … 7d" rings at 1% beside Gemini's own. A model read as any of
// its group's windows draws on the group.
func TestAntigravityQuotaModelsReadAsGroupWeek(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
at := func(d time.Duration) string { return time.Now().Add(d).UTC().Format(time.RFC3339) }
five, week := at(5*time.Hour), at(5*24*time.Hour)
gemini := `{"displayName":"Gemini Models","description":"Models within this group: Gemini Flash, Gemini Pro","buckets":[
+1
View File
@@ -266,6 +266,7 @@ func TestModelIDServingAndPrice(t *testing.T) {
// the account's own say of it is: the account's picks kept from before,
// and the variant an Antigravity family goes out as at an effort.
func TestModelIDAtAnAccount(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
prefsHome(t)
if err := os.MkdirAll(filepath.Dir(catalog.LivePath("antigravity")), 0o755); err != nil {
t.Fatal(err)
+3
View File
@@ -82,6 +82,7 @@ func TestUnreadLoginsWriteErrorsKeepCredentials(t *testing.T) {
// Valid JSON can still be unreadable as saved accounts. On a cold start,
// adding an account must keep those original credentials in a backup.
func TestUnreadLoginsFieldTypesKeptBeforeWrite(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
for _, tc := range []struct {
name string
text string
@@ -130,6 +131,7 @@ func TestUnreadLoginsFieldTypesKeptBeforeWrite(t *testing.T) {
}
func TestReadableLoginsNotKeptAside(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
for _, u := range []string{"a@x.com", "b@x.com"} {
if err := addGoogleLogin("antigravity", u, "", googleAuth{RefreshToken: "1//" + u, Project: "p"}); err != nil {
@@ -152,6 +154,7 @@ func TestReadableLoginsNotKeptAside(t *testing.T) {
// else) was read as no accounts, and the next account added wrote the
// file anew with that one alone: every saved sign-in gone.
func TestUnreadLoginsNotWrittenOver(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
for _, u := range []string{"a@x.com", "b@x.com"} {
if err := addGoogleLogin("antigravity", u, "", googleAuth{RefreshToken: "1//" + u, Project: "p"}); err != nil {
+1
View File
@@ -17,6 +17,7 @@ import (
// that followed left every account out (Packing1 on Discord, Windows 11:
// 「整行都没了,供应商里面antigravity直接消失了」 after an update).
func TestLoginsKeptWhileAnotherMagpieWrites(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
if err := addGoogleLogin("antigravity", "a@x.com", "", googleAuth{RefreshToken: "1//a", Project: "pa"}); err != nil {
t.Fatal(err)
+25 -1
View File
@@ -40,6 +40,7 @@ import (
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/yetone/magpie/internal/filememo"
@@ -292,7 +293,26 @@ func Movable(id string) bool { return movers[id] != nil }
// is listed by MoveCandidates with why, until it moves. The built-ins are
// retired one by one, each with its code (the owner, 10-16: 陆续把内置
// Provider下线掉), so this is the set retired so far.
func BuiltinRetired(id string) bool { return Movable(id) && retiredBuiltins[id] }
func BuiltinRetired(id string) bool {
if id == "antigravity" && antigravityBuiltinForTest.Load() > 0 {
return false
}
return Movable(id) && retiredBuiltins[id]
}
// antigravityBuiltinForTest counts the tests that serve the built-in
// Antigravity again (AntigravityBuiltinForTest).
var antigravityBuiltinForTest atomic.Int32
// AntigravityBuiltinForTest serves the built-in Antigravity again until the
// returned func runs. Its route has served nothing since it was retired on
// 11-15, and its code is still shared with Gemini CLI's: the tests of that
// route use this until the code is taken out (#6723).
func AntigravityBuiltinForTest() func() {
antigravityBuiltinForTest.Add(1)
var once sync.Once
return func() { once.Do(func() { antigravityBuiltinForTest.Add(-1) }) }
}
// retiredBuiltins are the built-in subscriptions whose code is gone.
var retiredBuiltins = map[string]bool{
@@ -309,6 +329,10 @@ var retiredBuiltins = map[string]bool{
"grok": true,
"devin": true,
CommandCodePlanID: true,
// Google bans accounts it sees on Code Assist through Antigravity's
// own client (the owner, 11-15): the plugin's 0.2.0 sends nothing and
// points to Antigravity (local agy CLI), which drives the user's agy
"antigravity": true,
}
// PluginServes is whether the built-in id's subscription is its plugin's to
+2 -2
View File
@@ -16,11 +16,11 @@ import (
func init() {
movers["antigravity"] = &mover{
pkg: "@magpie-community/opencode-antigravity-auth",
min: "0.1.18", // a variant at xhigh (Gemini 4 Hydrogen) is asked at xhigh (plugins#1169); 0.1.14: Gemini 4's late INVALID_ARGUMENT, a bare line in the stream, is asked again and says it isn't a region block (0.1.13 Codex's GPT-5 line reworded in a user's turn, 0.1.12 rewords instead of zero-width, 0.1.11 omp's "key words", 0.1.0 ported the built-in)
min: "0.2.0", // retired: sends nothing, points to Antigravity (local agy CLI) (owner, 11-15); 0.1.18 a variant at xhigh (Gemini 4 Hydrogen) is asked at xhigh (plugins#1169); 0.1.14: Gemini 4's late INVALID_ARGUMENT, a bare line in the stream, is asked again and says it isn't a region block (0.1.13 Codex's GPT-5 line reworded in a user's turn, 0.1.12 rewords instead of zero-width, 0.1.11 omp's "key words", 0.1.0 ported the built-in)
agents: []string{"antigravity"},
out: func() ([]Moving, error) {
var out []Moving
for _, l := range googleLogins("antigravity") {
for _, l := range googleSavedLogins("antigravity") {
a := l.acct.auth
if a.RefreshToken == "" {
continue
+1
View File
@@ -142,6 +142,7 @@ func TestPickedNamesAvoidCollisions(t *testing.T) {
// Picking a subset must not refill names Available deliberately left as ids.
// Unlisted picks still reserve all listed names and ids, even if not picked.
func TestPickedNamesKeepListed(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
home := t.TempDir()
t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))
t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))
+3
View File
@@ -741,6 +741,7 @@ func TestUpstreamNameAsGivesAModelTheNameItWasGiven(t *testing.T) {
// really went out — read against the family, every level of it reads as
// another model answering.
func TestSentNameInAsksForTheVariantTheEffortPicks(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
prefsHome(t)
// Antigravity's ids of one model at three levels, as its fetch left them
if err := os.MkdirAll(filepath.Dir(catalog.LivePath("antigravity")), 0o755); err != nil {
@@ -785,6 +786,7 @@ func TestSentNameInAsksForTheVariantTheEffortPicks(t *testing.T) {
// built by (codeAssistID) and the rule a ledger reads a record back against
// are one rule, and these are the two ends of it.
func TestSentNameInAsksAVariantIdForWhatTheEffortPicks(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
prefsHome(t)
// one model at three levels, and one at two, so a family's default is
// the top of it in one case and not the other
@@ -841,6 +843,7 @@ func TestSentNameInAsksAVariantIdForWhatTheEffortPicks(t *testing.T) {
// magpie knows, which is what the gateway's own dispatch (codeAssistID) reads
// the same way.
func TestSentNameIsJudgedByTheAccountAndNotByTheProviderId(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
prefsHome(t)
if err := os.MkdirAll(filepath.Dir(catalog.LivePath("antigravity")), 0o755); err != nil {
t.Fatal(err)
@@ -13,6 +13,7 @@ import (
// of text names them with their pool in place of the models' own, as the
// built-in's quota did.
func TestPluginWindowsKeepPoolAndFamily(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
week := float64(7 * 24 * 3600)
q := quotaOfPlugin(SubscriptionQuota{Provider: "antigravity", User: "a@gmail.com"}, plugin.Usage{Windows: []plugin.UsageWindow{
{Name: "Gemini 3.8 Flash", Model: "gemini-3.8-flash", Family: "gemini", Pool: "Gemini", Used: fptr(20), Span: week},
+2
View File
@@ -152,6 +152,7 @@ func TestCheckAlertsKeepsMarks(t *testing.T) {
// window is what should be told of, once per pool and named with it — not
// once for every model drawing on it, and not the 5-hour asides.
func TestDueAlertsPoolWindows(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
now := time.Date(2026, 10, 1, 9, 0, 0, 0, time.UTC)
reset := now.Add(48 * time.Hour)
five, week := 5*time.Hour, 7*24*time.Hour
@@ -203,6 +204,7 @@ func TestDueAlertsPoolWindows(t *testing.T) {
// does, so its renewal is reminded of too. The pools' 5-hour asides say
// nothing, as any 5-hour window does (#720: too often to be news).
func TestDueRemindersPoolWeekly(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
now := time.Date(2026, 10, 1, 9, 0, 0, 0, time.UTC)
soon := now.Add(20 * time.Hour)
five, week := 5*time.Hour, 7*24*time.Hour
+1
View File
@@ -211,6 +211,7 @@ func TestMergeQuotaHistory(t *testing.T) {
// the models' windows still aren't. Another measured window set aside for
// routing keeps its own line too (chowyuan1314, #4612).
func TestQuotaHistoryKeepsAntigravityPools(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
testenv.SetHome(t, t.TempDir())
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
t0 := time.Date(2026, 10, 27, 8, 0, 0, 0, time.UTC)
@@ -11,6 +11,7 @@ import (
// came back with the kept windows and no User, and 768 of 1,440
// Antigravity accounts each drew a card of its own on the Usage page).
func TestAccountReadingNamed(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
restart := func() {
lastQuotas.Lock()
+1
View File
@@ -108,6 +108,7 @@ func TestPlanLeftOutOfACopy(t *testing.T) {
// place of the models' drawing on it (the shapes TestAntigravityQuotaPools
// records): one span per pool window, the pool in its name.
func TestQuotaReportPoolsAntigravity(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
now := time.Date(2026, 10, 1, 9, 0, 0, 0, time.UTC)
reset := now.Add(48 * time.Hour)
five, week := 5*time.Hour, 7*24*time.Hour
+1
View File
@@ -177,6 +177,7 @@ func TestPastedAddressAndCallbackFinishOnce(t *testing.T) {
// bar doesn't offer it. Claude's is Claude Code's own (signin_claude_test.go);
// Command Code's, whose key is posted, is its plugin's (TestLoopbackPorts).
func TestLoopbackSignInsTakePastedAddress(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
claudeHome(t)
fakeCodexTokens(t, nil)
for _, agent := range []string{"codex", "gemini", "antigravity"} {
+1
View File
@@ -81,6 +81,7 @@ func TestImportBoxFinishesAPastedClaudeCode(t *testing.T) {
// What isn't a sign-in's end is left to import, and an address among
// refresh tokens is never sent to the vendor as one.
func TestImportTellsAddressesFromAccounts(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
for _, s := range []string{
`{"tokens":{"refresh_token":"rt_x"}}`,
"rt_abc123",
+2
View File
@@ -17,6 +17,7 @@ import (
// no accounts. Its last good generation, kept beside it, is read instead,
// and the user told.
func TestZeroedLoginsReadFromBackup(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
lastgood.Reset()
t.Cleanup(lastgood.Reset)
@@ -71,6 +72,7 @@ func TestZeroedLoginsReadFromBackup(t *testing.T) {
// With no backup, a zeroed logins.json is copied aside before an account
// added writes over it.
func TestZeroedLoginsWithoutBackupKeptAside(t *testing.T) {
t.Cleanup(AntigravityBuiltinForTest()) // the retired built-in route
googleSandbox(t, &fakeGoogle{})
lastgood.Reset()
t.Cleanup(lastgood.Reset)
+4 -5
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Claude・ChatGPT・GitHub Copilot のサブスクを他のコーディングエージェントで使う · magpie</title>
<meta name="description" content="Claude、ChatGPT、GitHub Copilot、Gemini Code Assist、Antigravity に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。">
<meta name="description" content="Claude、ChatGPT、GitHub Copilot、Gemini Code Assist に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
@@ -35,7 +35,7 @@
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="Claude Pro/Max・ChatGPT Plus/Pro・GitHub Copilot のサブスクを任意のコーディングエージェントで使う">
<meta property="og:description" content="Claude、ChatGPT、GitHub Copilot、Gemini Code Assist、Antigravity に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。">
<meta property="og:description" content="Claude、ChatGPT、GitHub Copilot、Gemini Code Assist に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/ja/subscriptions">
<meta name="twitter:card" content="summary_large_image">
@@ -46,7 +46,7 @@
{
"@type": "TechArticle",
"headline": "Claude Pro/Max・ChatGPT Plus/Pro・GitHub Copilot のサブスクを任意のコーディングエージェントで使う",
"description": "Claude、ChatGPT、GitHub Copilot、Gemini Code Assist、Antigravity に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。",
"description": "Claude、ChatGPT、GitHub Copilot、Gemini Code Assist に magpie で一度サインインすれば、そのモデルを Claude Code、Codex、Gemini CLI、OpenCode などのエージェントで使えます。複数アカウントとフェイルオーバーにも対応。",
"inLanguage": "ja",
"url": "https://usemagpie.ai/docs/ja/subscriptions",
"about": {
@@ -215,13 +215,12 @@
<tr><td>ChatGPT(Plus、Pro、Business)</td><td><code>codex/…</code></td><td><code>magpie accounts add codex</code></td></tr>
<tr><td>GitHub Copilot</td><td><code>copilot/…</code></td><td><code>magpie accounts add copilot</code></td></tr>
<tr><td>Gemini(Code Assist)</td><td><code>gemini/…</code></td><td><code>magpie accounts add gemini</code></td></tr>
<tr><td>Antigravity</td><td><code>antigravity/…</code></td><td><code>magpie accounts add antigravity</code></td></tr>
</table></div>
<ul>
<li><b>Claude。</b> Claude サブスクリプションでのリクエストは、コンピューターにインストールされた Claude Code を通じて送られるので、Claude Code はインストールしたままにしてください。</li>
<li><b>Copilot。</b> Copilot はコードを表示するので、GitHub のページで入力します。独自ドメインの GitHub Enterprise の場合:<code>magpie accounts add copilot --host &lt;name&gt;.ghe.com</code>。</li>
<li><b>Gemini。</b> これは Gemini CLI の Google サインインです。Google が応じるのは、専用の Google Cloud プロジェクトを持つ Code Assist Standard または Enterprise のアカウントだけです。プロジェクトは <code>magpie accounts project gemini &lt;email&gt; &lt;project&gt;</code> で指定します。</li>
<li><b>Antigravity。</b> サインインすると Antigravity の Claude と Gemini のモデルが使えます。</li>
<li><b>Antigravity。</b> <span class="ui">プラグイン</span>ページから <span class="ui">Antigravity (local agy CLI)</span> を入れてください(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。インストールしてサインインした agy CLI を動かすので、Google には agy 自身のリクエストとして届きます。magpie で Antigravity に直接サインインする方法は終了しました。その使い方をした Google アカウントは停止されます。</li>
</ul>
<p>その他のサブスクリプションは、magpie の <span class="ui">Plugins</span> ページからプラグインとして追加します。<a href="/docs/ja/plugins">プラグイン</a>を参照してください。</p>
+4 -5
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Use your Claude, ChatGPT or GitHub Copilot subscription in any coding agent · magpie</title>
<meta name="description" content="Sign in to Claude, ChatGPT, GitHub Copilot, Gemini Code Assist or Antigravity once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.">
<meta name="description" content="Sign in to Claude, ChatGPT, GitHub Copilot or Gemini Code Assist once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
@@ -35,7 +35,7 @@
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="Use your Claude Pro/Max, ChatGPT Plus/Pro or GitHub Copilot subscription in any coding agent">
<meta property="og:description" content="Sign in to Claude, ChatGPT, GitHub Copilot, Gemini Code Assist or Antigravity once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.">
<meta property="og:description" content="Sign in to Claude, ChatGPT, GitHub Copilot or Gemini Code Assist once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/subscriptions">
<meta name="twitter:card" content="summary_large_image">
@@ -46,7 +46,7 @@
{
"@type": "TechArticle",
"headline": "Use your Claude Pro/Max, ChatGPT Plus/Pro or GitHub Copilot subscription in any coding agent",
"description": "Sign in to Claude, ChatGPT, GitHub Copilot, Gemini Code Assist or Antigravity once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.",
"description": "Sign in to Claude, ChatGPT, GitHub Copilot or Gemini Code Assist once in magpie, and use its models in Claude Code, Codex, Gemini CLI, OpenCode and other agents, with several accounts and failover.",
"inLanguage": "en",
"url": "https://usemagpie.ai/docs/subscriptions",
"about": {
@@ -215,13 +215,12 @@
<tr><td>ChatGPT (Plus, Pro, Business)</td><td><code>codex/…</code></td><td><code>magpie accounts add codex</code></td></tr>
<tr><td>GitHub Copilot</td><td><code>copilot/…</code></td><td><code>magpie accounts add copilot</code></td></tr>
<tr><td>Gemini (Code Assist)</td><td><code>gemini/…</code></td><td><code>magpie accounts add gemini</code></td></tr>
<tr><td>Antigravity</td><td><code>antigravity/…</code></td><td><code>magpie accounts add antigravity</code></td></tr>
</table></div>
<ul>
<li><b>Claude.</b> Requests on a Claude subscription run through the Claude Code installed on your computer, so keep it installed.</li>
<li><b>Copilot.</b> Copilot gives you a code to enter on GitHub’s page. For GitHub Enterprise on its own domain: <code>magpie accounts add copilot --host &lt;name&gt;.ghe.com</code>.</li>
<li><b>Gemini.</b> This is Gemini CLI’s Google sign-in. Google answers it only for a Code Assist Standard or Enterprise account with a Google Cloud project of its own; <code>magpie accounts project gemini &lt;email&gt; &lt;project&gt;</code> names the project.</li>
<li><b>Antigravity.</b> Its sign-in gives Antigravity’s Claude and Gemini models.</li>
<li><b>Antigravity.</b> Install <span class="ui">Antigravity (local agy CLI)</span> from <span class="ui">Plugins</span> (<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>). It runs the agy CLI you installed and signed in to, so Google sees agy’s own requests. Signing in to Antigravity in magpie directly is retired: Google bans accounts used that way.</li>
</ul>
<p>Other subscriptions are added as plugins, from magpie’s <span class="ui">Plugins</span> page; see <a href="/docs/plugins">Plugins</a>.</p>
+4 -5
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>在任意 Agent 中使用 Claude、ChatGPT、GitHub Copilot 订阅 · magpie</title>
<meta name="description" content="在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot、Gemini Code Assist 或 Antigravity,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。">
<meta name="description" content="在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot或 Gemini Code Assist,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#fafafa">
<script>
@@ -35,7 +35,7 @@
<link rel="stylesheet" href="/docs.css">
<meta property="og:site_name" content="magpie">
<meta property="og:title" content="在任意 Agent 中使用 Claude Pro/Max、ChatGPT Plus/Pro、GitHub Copilot 订阅">
<meta property="og:description" content="在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot、Gemini Code Assist 或 Antigravity,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。">
<meta property="og:description" content="在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot或 Gemini Code Assist,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。">
<meta property="og:image" content="https://usemagpie.ai/img/og.png">
<meta property="og:url" content="https://usemagpie.ai/docs/zh/subscriptions">
<meta name="twitter:card" content="summary_large_image">
@@ -46,7 +46,7 @@
{
"@type": "TechArticle",
"headline": "在任意 Agent 中使用 Claude Pro/Max、ChatGPT Plus/Pro、GitHub Copilot 订阅",
"description": "在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot、Gemini Code Assist 或 Antigravity,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。",
"description": "在 magpie 里登录一次 Claude、ChatGPT、GitHub Copilot或 Gemini Code Assist,就能在 Claude Code、Codex、Gemini CLI、OpenCode 等 Agent 里用它的模型,支持多账号轮换和自动切换。",
"inLanguage": "zh-CN",
"url": "https://usemagpie.ai/docs/zh/subscriptions",
"about": {
@@ -215,13 +215,12 @@
<tr><td>ChatGPT(Plus、Pro、Business)</td><td><code>codex/…</code></td><td><code>magpie accounts add codex</code></td></tr>
<tr><td>GitHub Copilot</td><td><code>copilot/…</code></td><td><code>magpie accounts add copilot</code></td></tr>
<tr><td>Gemini(Code Assist)</td><td><code>gemini/…</code></td><td><code>magpie accounts add gemini</code></td></tr>
<tr><td>Antigravity</td><td><code>antigravity/…</code></td><td><code>magpie accounts add antigravity</code></td></tr>
</table></div>
<ul>
<li><b>Claude。</b>Claude 订阅的请求通过你电脑上安装的 Claude Code 发出,所以要保留 Claude Code。</li>
<li><b>Copilot。</b>Copilot 会给你一个验证码,在 GitHub 页面上输入。使用自有域名的 GitHub Enterprise:<code>magpie accounts add copilot --host &lt;name&gt;.ghe.com</code>。</li>
<li><b>Gemini。</b>这是 Gemini CLI 的 Google 登录。Google 只对有自己 Google Cloud 项目的 Code Assist Standard 或 Enterprise 账号提供服务;用 <code>magpie accounts project gemini &lt;邮箱&gt; &lt;项目&gt;</code> 指定项目。</li>
<li><b>Antigravity。</b>登录后可以用 Antigravity 的 Claude 和 Gemini 模型。</li>
<li><b>Antigravity。</b>在<span class="ui">插件</span>页安装 <span class="ui">Antigravity (local agy CLI)</span>(<code>magpie plugin add @magpie-community/opencode-agy-cli-auth</code>)。它运行你自己安装并登录的 agy CLI,Google 看到的是 agy 自己的请求。在 magpie 里直接登录 Antigravity 已下线:Google 会封这样用的账号。</li>
</ul>
<p>其他订阅以插件形式在 magpie 的 <span class="ui">插件</span> 页添加,见 <a href="/docs/zh/plugins">插件</a>。</p>