Commit Graph
30 Commits
Author SHA1 Message Date
yetone d9f63dfee8 antigravity: a model read apart from its group is a pool of its own; a model no window counts rests alone
runking on Discord: Antigravity has three groups (Gemini 3, Gemini 4,
Claude); Claude was used up, Gemini 4 not, and the card showed only
Gemini 5h/7d and Claude 5h/7d, no Gemini 4.

Cause: when retrieveUserQuotaSummary has no "Gemini 4 Argon" group (an
Ultra account's, whose Argon quota Antigravity-Manager reads in
Gemini's; or the prod endpoint's, per CodexBar), pools() put every
Gemini model into the family-wide "Gemini Models" pool, gemini-4-argon
too, though fetchAvailableModels gave it a reading of its own. The card
then showed Gemini's reading for it and hid Argon's.

Now a model is folded into its family's pool only when its own reading
matches the pool's 5 hours (share left within half a point, reset within
a minute when both tell one). Otherwise it is a pool of its own, named
as Google names the model without its level ("Gemini 4 Argon (High)" is
Gemini 4 Argon), with a week's span when its reset is past 5 hours. It
is Aside, as every pool is, so routing still reads the model's own
window. The GUI already shows a model's own pool ("Gemini 4 7d" ring);
its code is unchanged.

Routing: Allowance.Pooled said a model no window counts was the
account's. Antigravity's Gemini models that fetchAvailableModels gives
no quotaInfo (#3737) have no window, so a 429 on one rested the whole
account. When every window an account has is some models' only, a
refusal of a model none counts now rests the model. An account with a
window of its whole stays as before. A used-up Claude group already
rested only Claude's models.

pools() logs the summary's group names and bucket ids once per change
per account, under an 8-hex hash of the account, with no token or
email, so the next report shows the shape Google sent.

Run (mote, at this head): go test ./internal/provider ./internal/gateway
-count=1 -timeout 45m ok; GUI quota-pool-model, quota-pools,
quota-pool-order (Chromium and WebKit, en and zh) 12/12 ok; gofmt; GOOS
linux and windows go vet ./internal/provider ok.
Red on the old code: TestAntigravityQuotaModelApartFromGroup (Argon
folded into Gemini) and TestAllowancePooledModelNoWindowCounts (rests
the account).
Broken by hand: sameReading always false makes the "read alike" case red
(every Gemini model split off).
Not tried: a real account. The fixtures come from the proto in the agy
binary and the shapes Antigravity-Manager and CodexBar record, with and
without the Argon group. Whether runking's summary lacks the group, or
has it inside Gemini Models, is unconfirmed; the new log will show it.

Reported-by: runking (Discord)
2026-11-07 13:26:51 +08:00
yetone c57a5f7f58 gateway: a vendor's redirect to another origin is sent no provider key
Go's http.Client follows up to 10 redirects to any host, https to http
included, and on a hop to another domain drops only Authorization,
Cookie and WWW-Authenticate. So a vendor (or anything answering at its
URL) that redirected elsewhere got x-api-key, x-goog-api-key, api-key
and a provider's own headers sent there; Authorization too when only
the port differed, and all of them in the clear on an https to http
hop on the same host.

The class is fixed where the requests leave:
- provider.KeepsCredentials is a CheckRedirect that follows a redirect
  only to the request's own origin (scheme, host, port; or http to
  https on the same host and default ports), at most 10, and gives any
  other 3xx back as the answer (http.ErrUseLastResponse).
- provider.Keyed(c) is a copy of c with c's own CheckRedirect, then
  KeepsCredentials. Provider.do, the choke point of every p.Do, sends
  through it, and every http.DefaultClient.Do in internal/provider that
  carries a credential is Keyed(http.DefaultClient).Do. A copy per
  call, since netproxy.Install sets the default client's transport at
  run time. Left alone: Grok's public download, Antigravity's version
  URL and cline.go's unsigned read.
- the gateway's client (s.client, every vendor call), the Codex relay's
  and the Codex websocket's take KeepsCredentials, and so does
  chatgpt_api's siwcClient.

The native route needs nothing more: the vendor's 3xx comes back to
the caller as it came, Location included, and the caller decides.
Translated routes don't follow either, rather than following with
credentials stripped: it is the rule search_api.go had already (#1580),
no vendor magpie speaks to was found redirecting its API to another
origin, a stripped request elsewhere would only fail with a confusing
401, and the vendor-URL downloads (video, images) are fetched unsigned
through vendorClient, so they are not affected.

Tests: TestRedirectKeepsTheKeyAtItsOrigin (307 and 302 elsewhere with
Authorization, x-api-key, x-goog-api-key, api-key and a custom header;
a same-origin redirect followed with every key; three clients),
TestRedirectNeverDowngrades (an https vendor's redirect to http on its
own host and port), TestSameOrigin, TestKeyedKeepsTheClientsRule,
TestNativeRedirectKeepsTheKey (Anthropic and Gemini providers with an
own header) and TestChatRedirectKeepsTheKey.

Broken by hand: with Provider.do back on client.Do and s.client
without CheckRedirect, the thief got every key header, /away answered
200, the https vendor's /plain was followed (400 from the TLS port
spoken to in http), the native route's claudeish and gem answered the
thief's {"stolen":true} with Authorization, X-Api-Key and
X-Relay-Secret sent there, and the chat route sent Api-Key,
Authorization and X-Relay-Secret to it. TestSameOrigin and
TestKeyedKeepsTheClientsRule don't depend on the wiring and passed.

Run on mote at the pushed head 883690a0b (this commit and the next,
on origin/main 9a0aab32c): gofmt -l clean, go vet, GOOS=windows go vet
and GOOS=linux -tags nogui go vet all clean. go test ./... -timeout 45m
-count=1: 84 packages ok, including internal/gateway. 3 red, each filed
and none in this change's path:
- TestMainWindowCorners/macOS_26_SDK (gui, macOS 27, #3949)
- TestRenewLoginsKeepsClaudeReading (provider, #5481). It is red 3 of 3
  at the base 49c9491b7 without either commit.
- TestHostEndedEndsWhatItsPluginStarted/own_end (plugin, a 30s wait in
  a full run; passes 3 of 3 alone at this head, #5515)
This commit alone, at its first base 49c9491b7, ran the same way with
TestUnroutedHeldReportSaved (gateway, #4300) red besides.
Rebased then onto origin/main 303a31dd6 (which fixed #5481) and run
again at that tree: gofmt and the three vets clean, and internal/gateway,
internal/provider, internal/plugin and internal/netproxy all ok.
Rebased on 19c45d5d4, which changes gateway.go (kept_error), Codex's
usage_limit_reached, Cursor's mover min, sessions and the GUI; ran
gofmt, go vet ./internal/..., GOOS=windows go vet of gateway and
provider, and go test ./internal/gateway ./internal/provider: both ok.
Rebased on 94d4866b5, which changes only internal/sessions; ran gofmt,
go vet of gateway, provider and sessions, and this change's own tests
(-run Redirect|DropsProxyIdentity|SameOrigin|Keyed): ok.
Rebased on cd77c725d, which changes only internal/provider's check-in;
ran gofmt, go vet of gateway and provider, and this change's own
tests again: ok.
Not tried: a real vendor's redirect (none found that does), and the
plugin host's fetch (host.js; Bun follows redirects by default), which
is filed as #5508.
2026-11-06 19:50:18 +08:00
yetone 8e97e26d67 providers: WorkBuddy's sign-in warns that Tencent may ban the account first
NancyTom on X (11-04): WorkBuddy accounts used from DeepSeek Harness
through magpie were banned, the international build's (WorkBuddy AI)
most; repliers saw the same. Changing DSH's prompt isn't a fix: the
plugin already rewords DSH's opener and moves the system prompt into
the first user turn (REFUSED.md), and the bans came anyway. So magpie
says it before an account is added, as it does for Claude, Zed, Qoder,
Factory, MiMo and Command Code.

- app.js: WorkBuddy and WorkBuddy AI carry risk with WORKBUDDY_RISK.
  A moved subscription (every user's now) gets it through subOf, so
  the plugin's sign-in waits behind "Sign in anyway" too.
- i18n.js: zh, zh-TW, ja, de.
- CLI: `magpie accounts add workbuddy|workbuddy-ai` asks the same
  (provider.WorkBuddyRisk, the window's words; a GUI test checks the
  two are equal).
- Core script budget: no raise; the SUBS header comment was cut down.

Run (mote, at 823e7c250 + this change):
- node --test workbuddy-risk (new), i18n-keys, i18n-en-no-cjk,
  commandcode-risk, zed-sub, claude-risk, qoder-cn-tile: 51 pass, 0 fail,
  chromium and webkit, en and zh.
- 83 GUI files matching add-|sub|risk|workbuddy|plugin-sign|move|
  deprecat|signin|i18n: 1166 pass, 20 fail at load ~60. Alone:
  signin-closes-sheet passes; found-skill-pick-remove (#5013),
  plugin-move-unserved (#4410) and routing-rule-remove (#5088) red
  alone the same way on a fresh origin/main e3ed21c7a (18 fail there).
- go test ./internal/cli ./internal/provider ok; -run Budget
  ./internal/gui ok; go vet cli+provider darwin and windows, provider
  linux ok (cli's linux vet needs GTK's cgo, not on mote or WSL).
- gofmt -l clean.
- Rebased on 9d0c9b41e (app.js changed under it, #5139): -run
  Budget|Risk ./internal/gui ./internal/cli ./internal/provider ok, and
  workbuddy-risk, i18n-keys, i18n-en-no-cjk, qoder-cn-tile, claude-risk
  39 pass, 0 fail at the pushed head.

Broken by hand: risk taken off both entries, workbuddy-risk went pass 1,
fail 14 (the built-in tiles and the moved plugin's sign-in each asked
the backend at once); the text-equality case stayed green, as it should.

Not run: the whole GUI suite (another session's full GUI suite was on
mote). Not tried: a real WorkBuddy sign-in; nothing here touches the
plugin or what is sent to Tencent.
2026-11-04 23:58:53 +08:00
yetone 69eb93e0a2 antigravity: an account's tiers are asked again each hour, so one that became Ultra lists Gemini 4 without a restart (rick_49551 on Discord)
rick_49551 reports an Antigravity account on Google AI Ultra whose model
list in magpie has no Gemini 4. magpie lists whatever fetchAvailableModels
gives, less chat_/tab_ ids, six fixed ids and the models Google marks
disabled; which models Google gives depends on the tier named in
entitlement.userTier, and that tier came from loadCodeAssist once per
magpie run: googleState.projects kept it with no expiry, while Gemini
CLI's experiments (flags) are asked again each hour. An account that
became Pro or Ultra after magpie first asked went on naming its old tier
(none, for a free account) in every hourly relist, and Google went on
listing it gemini-4-argon-disabled with "disabled": true, as it does the
owner's free account today (app.log 11-04: "disabled
[gemini-4-argon-disabled]"), which a7ed2f61d leaves out. Only a restart
asked again.

Now the list (modelInfo) asks loadCodeAssist again once the tiers are an
hour old, keeps the project, and takes the new current/paid tier and plan;
a failed or empty answer keeps the old ones for another hour. A change is
logged with the old tiers. The request path (project()) is unchanged, so
no request waits on loadCodeAssist.

Tests: TestAntigravityTierAskedAgainAfterUpgrade (free account, then the
fake's loadCodeAssist says g1-ultra-tier "Google AI Ultra": within the hour
no new loadCodeAssist; an hour on the list names g1-ultra-tier and has
gemini-4-argon, the plan reads Google AI Ultra; a failed loadCodeAssist
keeps it).
Broken by hand: with the antigravityTiers call commented out it fails
"Ultra: models [gemini-3.8-flash-high], want [gemini-3.8-flash-high
gemini-4-argon]"; restored, it passes.
Run (mote, at this tree): gofmt -l; go vet ./internal/provider/ on darwin,
GOOS=linux -tags nogui, GOOS=windows; go test -tags nogui -count=1
./internal/provider/ (ok, 138s).
Not tried: a real Ultra account. The Ultra fixture (gemini-4-argon enabled
under g1-ultra-tier) is inferred from the free account's real list and
Google's forum notes, not rick's bytes. Whether this is rick's case
depends on his magpie log's loadCodeAssist/fetchAvailableModels lines:
if loadCodeAssist itself has no paid tier, or Google refuses
g1-ultra-tier (400), this change doesn't help, and those lines say so.
2026-11-04 17:46:30 +08:00
yetone 7c900f468f antigravity: a tier Google refuses in fetchAvailableModels is asked once a day and is no "Model list" row (ferock4669)
ferock4669 on Discord: with an Antigravity subscription, the Requests
page filled with "Model list" (模型列表) rows for
/v1internal:fetchAvailableModels, each answered 400.

Cause. For an account loadCodeAssist gives a paid or non-free tier,
magpie asks fetchAvailableModels first with entitlement.userTier named
(7806395c7: the paid tier, then the current tier) and, on a refusal,
again without one. The only real paid account seen (#1553, AnxForever's
log: free-tier, paid g1-pro-tier, aicode-consumers) gets 400
INVALID_ARGUMENT "Request contains an invalid argument." for the named
tier and its list from {project} alone. magpie remembered nothing, so
every list (start-up's FetchNew, the hourly relist, Refresh, sync) and
every quota reading sent that 400 first, and each list ran under a
probelog KindList mark, so the refused request was written down as a
failed model_list row (quietProbe hides only answered lists). The list
itself came from the second request. The request without a tier is
what CLIProxyAPI, sub2api and Antigravity-Manager send; the value the
official client puts in userTier for a paid account is still not known
(Antigravity isn't installed on any box here, nothing captured in the
repo), so the request isn't changed beyond not repeating the refusal.

Now:
- a tier Google answers 400 is left out of that account's
  fetchAvailableModels (lists and quota readings) for tierRefusedFor
  (24h), keyed by refresh token, project and tier, so a tier the account
  newly has is still asked; a 503 or other failure doesn't rest it;
- a request with a tier named is sent under probelog.Taken: a step
  towards the list, no row of its own; the request without one is
  written down as any list, so a list that really fails is still one
  400 row under Failed;
- googleAccount.call returns codeAssistError carrying the status, with
  the same message text as before.
Retries: FetchNew asks an account with no list at most every
newFetchRetry (1 min) while a page is open, the relist hourly; with this
a refused tier adds no extra request to either.

Docs: gateway-sessions.md (a list's step is no row) and
providers-accounts.md (askTiers, tierRefusedFor).

Tests: TestAntigravityRefusedTierAskedOnceAndNoRow (#1553's replies:
three Fetches and a quota reading name the tier once, 5 requests, no 400
row; a day later it is named again; a list refused without a tier too is
one row "400 model_list /daily/v1internal:fetchAvailableModels") and
TestAntigravityTierNotRestedForOtherFailures (a tier answered 503 is
named again). Broken by hand on mote:
- without probelog.Taken: FAIL "a refused tier written down:
  {... Kind:model_list ... Endpoint:/daily/v1internal:fetchAvailableModels
  Status:400 ...}";
- without tierRefused: FAIL "asked 8 times, 4 with the refused tier
  named; want 5 and 1".
Both pass with the change, as do the existing tier tests
(TestAntigravityTierRefusedFallsBack, ...ProInvalidTierAsksWithoutOne,
...TierFreeAndKeptProject, ...ProAccountNamesItsTier).

Run on mote (mote-run), at efb55b5c9 + this change: gofmt -l on the
changed Go files prints nothing; go vet ./..., GOOS=linux go vet -tags
nogui ./..., GOOS=windows go vet ./... exit 0; go build, GOOS=linux go
build -tags nogui, GOOS=windows go build exit 0; go test -count=1 -tags
nogui -timeout 45m ./... under a sandbox HOME with pinned caches: exit
0, 77 packages ok, no FAIL. Rebased on origin/main b3edcabf2 (no change
to google.go, probelog or usage's probes) and ran internal/provider,
internal/probelog and internal/usage again at the pushed head: ok.
GUI suite not run: no file under internal/gui changes.

Not tried: a real Google AI Pro/Ultra account (none here), so the 400
in ferock4669's rows is matched to #1553's by shape, not by their log;
the official Antigravity client's userTier value for a paid account.
2026-10-28 19:07:21 +08:00
yetone 2009d33a65 usage: Gemini 4 Argon's own quota group shows beside Gemini's and Claude's, and keeps Claude's in view (01huadalang on Discord)
01huadalang: "反重力有 Gemini 4的条子是7天,有没有5h 的条子,而且有 Gemini 4的条子怎么 claude 的条子没有了".

Google now reports a third group in retrieveUserQuotaSummary for paid
accounts: "Gemini 4 Argon", "For paid Pro plans, Argon quota is
separate", with one bucket, gemini-argon-wtu-weekly, window weekly. That
shape is agy 1.4.0's own /usage output, recorded in CodexBar #4585 and its
test fixture; agy itself shows Gemini 5-hour, Gemini weekly and Gemini 4
Argon weekly, no Argon 5 hours. So there is no 5-hour bar for Argon to
show: Google sends none.

Claude's bar went because the GUI showed only some pools:
- poolLine (an account row on the Providers page) drew pools.slice(0, 2)
  and put the rest in the tooltip;
- the menu bar panel's card drew fam.slice(0, 4) rings;
- poolWindows sorted pools by their first word, so "Gemini 4 Argon"
  ranked with Gemini, before "Claude & GPT".
With three pools, Gemini and Gemini 4 Argon took both places and Claude &
GPT dropped out of sight. The panel also labelled Argon's ring "Gemini 7d",
the same as Gemini's own.

And in Go, pools() matched a model to the first group whose name or
description holds its family: gemini-4-argon went into Gemini's pool (and
its tooltip), and a versioned group listed first with a 5-hour bucket
would have taken every Gemini model.

Now:
- pools(): a group whose name says a version and that a model's name or id
  begins with ("Gemini 4 Argon") is that model's, whatever its windows; the
  family-wide match skips versioned groups and, as before (#745), needs
  the group's 5 hours.
- app.js: every pool shows on an account row (the line already wraps) and
  every pool window on the panel card (a closer gap past four rings); a
  pool named for a model sorts after the family pools, as agy lists it;
  its ring reads "Gemini 4 7d" (poolWord); the #745 fallback, which shows
  a family's own 5 hours before a week-only pool's week, isn't applied to
  a model's pool.

Tests, each red on the old code:
- TestAntigravityQuotaModelGroup: the agy groups in agy's order, Argon
  listed first, and Argon first with a 5-hour bucket. Old code put
  gemini-4-argon in Gemini, and in the last case gemini-3-flash in Gemini 4
  Argon.
- quota-pool-model.test.cjs (Chromium, WebKit; en, zh): the Usage page has
  every group's windows in order; the panel has five rings, Claude's among
  them, labelled Gemini 5h/7d, Claude 5h/7d, Gemini 4 7d, all fitting;
  the account row has Gemini, Claude & GPT, Gemini 4 Argon. Chromium was
  red on the old app.js (order).

Run at the pushed head's tree (7b1faf99f plus this change; rebased on
40a0b442c, which touches only internal/cli):
- go test -tags nogui -count=1 -timeout 45m ./... under a sandbox HOME:
  every package ok;
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui for
  internal/provider and internal/gui;
- GUI, both engines, 76 files (quota-*, panel-usage, panel-quota-*,
  tray-usage*, usage-accounts*, usage-card-refresh, usage-quota-head,
  i18n*, old-webkit, click-scroll): 299 of 303 passed. quota-families
  Chromium zh hit a 180s browser launch timeout at load 75 and passed when
  rerun. quota-count-wrap (WebKit, 1100px) and quota-reads (WebKit de 360)
  are red the same way on the untouched 7b1faf99f, already filed as
  #3404/#2228 and #3406/#2150.

Not tried: a real Antigravity account. The Argon group's shape comes from
agy's recorded output, not from a call made here. A summary from the
cloudcode-pa OAuth endpoint may lack the Argon group (CodexBar saw that);
in that case nothing changes.
2026-10-25 02:22:07 +08:00
yetone 106a245502 gateway: a request's body goes once it is answered, not when its stream ends (#3383)
The transport holds a request until its reply's body is closed, a
stream's whole length, and with it the bytes.Reader body and the GetBody
NewRequest made over it. So every streaming request kept the body it
sent upstream alive to its end: for a Claude Code request translated to
Chat, the marshalled body (marshalRaw/appendHTMLEscaped in the report's
heap, 503 MB live).

provider.SetBody gives a request a body whose reader drops its bytes
once read and whose GetBody reads them again until provider.LetGo.
forwardOnce lets go once its retries (RetryOneAuth, RetryZhipuCoding)
are done; Codex's zstd turn, Copilot Auto's model swap and Gemini's Code
Assist envelope set their bodies the same way, so LetGo reaches them.

Run (worktree perf-stack, on the four commits before it, over
origin/main 137187a40):
- a heap probe, 8 Claude Code requests of 4.7 MB held mid-stream to a
  Chat upstream: 152 MB held before, 88 MB after; the rest is the body
  as it came (another member) and as read (a continuation). Anthropic
  to Anthropic holds the body once, 41 MB.
- TestStreamingRequestsLetTheirSentBodyGo (bar 3x the body each) and
  TestSetBodyLetsItsBytesGo: green; red with LetGo commented out of
  forwardOnce ("8 streaming requests of 4 MB hold 166 MB, 4.2 times the
  body each") and with LetGo storing nothing ("the request holds its
  body's bytes after it was answered").
- go test ./internal/provider/ ./internal/redact/ ok; ./internal/gateway
  -run 'Mask|Redact|Codex|Copilot|Gemini|Google|Antigravity|Zhipu|Auth|
  Retry|Stream|Continu' ok; GOOS=linux and windows vet -tags nogui
  clean, gofmt clean. The full suite runs at the pushed head.
Not tried: a real vendor; the bytes on the wire are the same.
2026-10-24 21:00:05 +08:00
yetone 7765f27fcc gateway: a model an account refuses goes on to the accounts not listing it yet
01huadalang (Discord): Antigravity with several accounts, only some can
use Gemini 4. The model and its bar showed only after the right account
was made preferred and probed, and a request failed with the preferred
account's error instead of going on to the account that serves it.
st3lland (Discord): on ZCode (plugin) accounts serve different models.
Owner: no manual setting, magpie knows per account and routes.

Two causes:
- perKeyBarred puts an account whose own saved list lacks the model in
  pl.unlisted / pl.left (Unlisted) and serve never asked it. So when
  the listing accounts refused the model (Antigravity's real 404
  NOT_FOUND "Requested entity was not found.", codeAssistModelMissing;
  plugins through modelRefused's unservedWords), the agent got that
  error even though an account whose list was simply stale serves it.
  Now, once every listing account of that subscription/model has been
  asked and one refused it as unserved (unservedTry), its unlisted
  accounts are asked next, right after it and before any other member
  or fallback (unlistedNext, askUnlisted for the trace). The refusing
  try rests as before (restAfterMarked, for that model). Not for a
  pinned account, a sealed conversation or strict affinity; a gateway
  key's account list narrows unlisted too (allowedCandidates). Other
  refusals (403 PERMISSION_DENIED, 429 RESOURCE_EXHAUSTED) don't open
  the unlisted accounts.
- Antigravity's per-account lists were refreshed only on the first
  listing, a probe, a sync or a Refetch, so a model granted later and
  its bar (chosenWindows filters by exposed models) stayed hidden. Its
  quota reading already fetches fetchAvailableModels per account; now
  it saves that account's list (noteAntigravityList) and re-merges the
  pooled list from every On account's list when it changed. An Off
  account's reading changes nothing.

Other vendors: the unlisted route only opens on the existing unserved
classifiers (Antigravity's 404, plugins' unservedWords), unchanged here;
TestUnlistedAccountNotAskedForOtherRefusals holds that the other real
Antigravity bodies don't open it.

Run (at the rebased head on origin/main 5222a4b12):
- go test ./internal/gateway -run TestUnlistedAccount (4 new) and
  ./internal/provider -run 'TestAntigravityQuotaReadingListsNewModels|
  TestAntigravityModelsAcrossAccounts': ok.
- Targeted: ./internal/gateway -run 'Unlisted|Antigravity|Fallback|Refus|
  Unserved|KeyModel|Lists|Plan|Rest' and ./internal/provider -run
  'Antigravity|Google|Gemini|Pool|Lists': ok (gateway 34.9s, provider 4.5s)
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- Full suite: queued behind three other sessions' full runs on this
  machine (load ~300); its result goes on this commit's follow-up, not
  claimed here.
- GUI: no asset changed; none run.

Broken by hand, each red, then restored:
- unlisted fallback off (false && unservedBy[key]): AskedAfterModelRefused
  404, BeforeFallback served a's fallback.
- unlisted appended after fallbacks instead of inserted: BeforeFallback red.
- key doesn't narrow unlisted: HeldFromKey got b's 200, want a's 404.
- quota reading keeps no list: QuotaReadingListsNewModels pooled list
  lacks Gemini 4.

Not tried: no real Antigravity accounts with and without Gemini 4 (the
404 body is the one on record from earlier reports); no real ZCode
"model not available" body is on record, so none was invented and ZCode
relies on modelRefused's existing words; the plugins repo is unchanged
(ZCode's models(provider,{auth}) already lists per account). Known
limit: a resting listed account that is the lone candidate is still
asked first on later turns until the unlisted account's list refreshes
at its next quota reading, one extra request a turn.
2026-10-24 20:32:33 +08:00
yetone a7ed2f61d9 antigravity: a model Google marks disabled is left out of the list (kwanyu on Discord: gemini-4-argon-disabled answered 404)
kwanyu picked an Antigravity model in DeepSeek Harness and every request
was a 404 "Requested entity was not found" for gemini-4-argon-disabled.
The id is not made by the Harness: its source (HEAD 22ddee379), the
bundled pi-ai 1.3.0 and dsh's patch add no suffix to a model id, and
magpie's gateway has no generic suffix either. It is Antigravity's own:
a real account's fetchAvailableModels lists gemini-4-argon-disabled with
"disabled": true (magpie's log: "disabled [gemini-4-argon-disabled]"),
and modelInfo kept every disabled model in the list ("still listed, as
before", since 7806395c7 only logged them). So magpie offered it to
every client, the Harness among them, and Google refuses it.

Now a model Antigravity marks disabled is left out of the list, as the
chat_/tab_ ids are, and the log still names it under "disabled". It
comes back on the first refresh after Google enables it. This is not
scoped to the Harness: the id comes from the list every client reads,
and no client can use it. Every other model's id, name and quota are as
Google sent them.

Tests: TestAntigravityDisabledModelLeftOut (the real ids beside
gemini-4-argon-disabled; gpt-oss with "disabled": false stays) is red
on the old code (the list had gemini-4-argon-disabled) and green now.
TestAntigravityProAccountNamesItsTier and
TestAntigravityProInvalidTierAsksWithoutOne listed their made-up
disabled claude-sonnet-5-5 and now count it left out.

Run: gofmt -l; go vet ./... on darwin, GOOS=linux -tags nogui, and
GOOS=windows; go test -tags nogui -count=1 ./internal/provider/ under a
sandbox HOME (ok, 103s).
Broken by hand: with google.go put back, TestAntigravityDisabledModelLeftOut
fails listing gemini-4-argon-disabled.
Not tried: a real Antigravity account refresh with this build, and
DeepSeek Harness's picker after it; Antigravity's own client's handling
of a disabled model was not read from its binary (not installed here).
A Harness profile written before keeps the id until magpie's next sync
of the Harness's models.
2026-10-24 00:48:04 +08:00
yetone 16327872c3 provider: Antigravity's retired 2.5 Flash models are named for themselves again, with no tagDescription to go by (新v学员 on Discord)
新v学员 (#feedback, 10-20; Antigravity on a Google AI Plus plan): three
chips in the subscription's model list read "Gemini 3.5 Flash Lite", and
only one was gemini-3.5-flash-lite; hovering the others showed
gemini-2.5-flash and gemini-2.5-flash-lite.

Cause: Antigravity's fetchAvailableModels still names gemini-2.5-flash,
gemini-2.5-flash-lite (and the hidden -thinking) "Gemini 3.5 Flash Lite".
b68377dae (#1918) renamed them only when their tagDescription named
another family. Google no longer sends a tagDescription for these, and
where it sends one now it is a notice ("GPT-OSS will be removed from
Antigravity on November 2, 2026."), so nothing was renamed. Checked on the
owner's account today: no tagDescription on any Gemini model.

Fix: a model is named for its own id (catalog.NameOf, else its id) when
its name is spelled by another family's id in the list
("Gemini 3.5 Flash Lite" is gemini-3.5-flash-lite), or when its enum
names its own id (MODEL_GOOGLE_GEMINI_2_5_FLASH is gemini-2.5-flash;
models Antigravity names correctly carry MODEL_PLACEHOLDER_M…), which
covers an account whose list has no gemini-3.5-flash-lite. Levels of one
model (gemini-3.7-flash, -low) and a name no id spells, such as
gemini-3-flash-agent "Gemini 3.5 Flash (High)", stay as given. The same
names reach /v1/models, agents' lists and Usage's windows, since all of
them read modelInfo. The GUI's own way of showing what tells same-named
models apart (a77ecbf8a) is unchanged.

Test: TestAntigravityRetiredModelNamedWithoutTag reads
testdata/antigravity-models-2026-10-20.json, the real fetchAvailableModels
reply of today with MIME types and experiments left out. It runs three
cases: the list as given (all three ids that read "Gemini 3.5 Flash
Lite"), the list without gemini-3.5-flash-lite, and the 2.5 models with
placeholder enums. In each, no two models read the same and both 2.5 ids
are named for themselves. On the old google.go it fails in two cases:
"gemini-2.5-flash and gemini-2.5-flash-lite both read "Gemini 3.5 Flash
Lite"", "gemini-2.5-flash is named "Gemini 3.5 Flash Lite", not for
itself", plus the same for Usage's windows. With the enum rule broken by
hand, "no gemini-3.5-flash-lite" fails; with the spelled-name rule
broken, "placeholder enums" fails. TestAntigravityRetiredModelNamedForItself
(#1918's fixture) still passes.

Real use: built with -tags nogui and run as `magpie serve` with
MAGPIE_ADDR=127.0.0.1:3488 in a sandbox HOME, holding only a copy of the
owner's Antigravity login (free tier). /v1/models listed
gemini-2.5-flash "Gemini 2.5 Flash", gemini-2.5-flash-lite "Gemini 2.5
Flash-Lite", gemini-3.5-flash-lite "Gemini 3.5 Flash Lite" and
gemini-3-flash-agent "Gemini 3.5 Flash (High)". Not tried on a Plus account
or in the reporter's Windows/Linux GUI.

Run in a fresh worktree on origin/main e4ac5e871: gofmt -l clean; go vet
./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... all
clean; go build, GOOS=linux go build -tags nogui, GOOS=windows go build
ok; `set -o pipefail; go test -timeout 45m ./...` at load 360-450:
64 packages, 61 ok (internal/provider 806s), 3 red, each already filed:
internal/agent past 45m (TestMorphContextWindow at the deadline, #2544,
#2723), internal/gateway past 45m (TestTierRecordedPerTry at the
deadline, #2870, #2108), internal/middleware TestOnUsageRows
"strategies.seen: took too long" (#2687). None of them reads
Antigravity's names.
No GUI file changed, so the GUI suite was not run.
2026-10-20 02:49:50 +08:00
yetone b68377dae7 provider: Antigravity's retired 2.5 Flash models are named for themselves, not "Gemini 3.5 Flash Lite" (#1918, kchen0x)
What changed: Antigravity's fetchAvailableModels gives gemini-2.5-flash,
gemini-2.5-flash-lite and gemini-2.5-flash-thinking the displayName
"Gemini 3.5 Flash Lite" and the tagDescription gemini-3.5-flash-lite
(checked on the owner's account, 2026-10-13). magpie showed three
buttons of that name and the same name in /v1/models and the quota
windows. When several models share a name, one whose tagDescription
names another family is now named from the catalog, or by its id. A
model tagged with its own family (the effort levels of one model) keeps
the shared name.

Run: go test ./internal/provider/ (ok). TestAntigravityRetiredModelNamedForItself
is built from the reporter's JSON plus two effort levels of one model;
with the renaming removed it fails (both 2.5 models "Gemini 3.5 Flash
Lite", two models read the same). gofmt -l clean; go vet -tags nogui on
darwin, linux and windows.
2026-10-13 14:14:59 +08:00
yetone 96d497e687 antigravity: a refused or failed model list says what magpie does next, and an account that couldn't refresh says so (#1553, AnxForever)
AnxForever's Google AI Pro account (loadCodeAssist: current tier
free-tier, paid tier g1-pro-tier, project aicode-consumers) gets
"Request contains an invalid argument." for fetchAvailableModels with
entitlement.userTier g1-pro-tier, and ends up with the catalog's
models. magpie already asks once more with {project} alone after that
refusal, but the log didn't say so, and when that second request also
failed nothing was logged at all: antigravityPoolModels kept the
account's last list silently whenever another account (here the
reporter's free one) succeeded.

What changed (logging only; the requests are unchanged):
- a refused tier's line now ends "; asking with <next> next" or
  "; asking with none next";
- a failure of the request with no entitlement is logged with the
  endpoint and project;
- the pool logs each enabled account whose refresh failed, with the
  error and how many models it keeps from before.

Why the request is not changed: no authoritative source for the value
the official client puts in entitlement.user_tier for a paid account
was found. The Antigravity app is not installed on this Mac. The
extracted language-server schema (jkfujinami/antigravity-grpc-schemas,
model_configs.proto / entitlement.proto) confirms the field shape magpie
sends: FetchAvailableModelsRequest{project=1, request_id=2,
entitlement=9 {user_tier string}, location=3}; the LS also has
License{userTier, tierDisplayName, projectId, location} and
SelectLicense, so the tier it names may come with its own project or
location, but nothing public shows the values. Every open-source client
that serves Pro accounts sends {"project": ...} only, on
daily-cloudcode-pa: CLIProxyAPI (sdk/cliproxy/antigravity_models.go),
sub2api (backend/internal/pkg/antigravity/client.go),
Antigravity-Manager (src-tauri/src/modules/quota.rs, which notes the
list is the same for free and Pro accounts), syrtis. magpie's fallback
already sends exactly that, so a guessed tier value is not added.

TestAntigravityProInvalidTierAsksWithoutOne is built from the
reporter's log lines: the first fetch is
{entitlement:{userTier:g1-pro-tier}, project:aicode-consumers} and gets
400 INVALID_ARGUMENT, the second is {project:aicode-consumers} and its
list is used; then, with the second refused too, the account keeps its
3 models and both failures are in the log. Removing the pool's log
line turns it red.

Run: gofmt -l; go vet -tags nogui ./internal/provider (darwin,
GOOS=linux, GOOS=windows); go test -tags nogui -count=1 ./internal/provider;
go test -tags nogui -timeout 40m ./... under a temp HOME: every
package ok but internal/provider, where only
TestAccountDiscoveryOffReadsNoSignIn failed ("the watch didn't answer a
read: {}{}"). It fails the same way at every run from this agent's
checkout under .claude/worktrees, and passes at this same commit and at
origin/main from a checkout under the scratchpad, where the whole
internal/provider package passes too; it touches no Antigravity code.

Not verified: no Google AI Pro account was available. Whether the
reporter's second request ({project} only) succeeds or fails, and why,
is not known; this commit makes the next release's log say which.
2026-10-11 12:23:58 +08:00
bocayouth b45b410b0c fix: discover Antigravity models across enabled accounts (#706) 2026-10-05 02:16:28 +08:00
yetone c7f693b506 quota: an Antigravity pool with only its week keeps its models' 5-hour windows (#745, werldl517-cyber: PooledWindows drops per-model 5h windows tagged with a pool when the pool's summary has only the 7-day aggregate) — pools() took each of retrieveUserQuotaSummary's buckets on its own, a disabled or unreadable one skipped, and then gave every model of a group that had any bucket left its Pool; PooledWindows put a pool's own windows in place of every model window tagged with that pool once the pool had any window of its own. So a summary with a group's weekly bucket and not its 5-hour one (disabled, or not sent) left the group's "7 days" and dropped the models' 5-hour readings from fetchAvailableModels, the only 5 hours to be had, from the CLI's and TUI's quota lists, /v1/magpie/quotas and quota alerts (dueAlerts reads PooledWindows too). pools() now puts a group's models in its pool only when the group has a 5-hour window, the one that stands in for theirs (the GUI's poolWindows, which keys on the models' pool, then shows them as families beside the pool's week); and PooledWindows drops a model's window only for a pool window of its span (modelSpan, 5 hours, for a model window without one, as fetchAvailableModels' are), so a window tagged by other means isn't lost either. A full summary (5 hours and week) reads as before. TestPooledWindowsPartialAggregateKeepsModelFallback is the reporter's repro plus the cases they listed (both windows, week alone, 5 hours alone, none), and TestAntigravityQuotaPools gains a summary with Gemini's week and its 5 hours disabled, read end to end through quota(): the models' four windows and Gemini · 7 days; both fail on the old code. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried with a real Antigravity account answering a partial summary. 2026-10-04 12:15:40 +08:00
yetone 7806395c74 antigravity: a Google AI Pro account asks for its models with its plan named, as Antigravity does, and the log says what Google answered (Discord: a Pro account on magpie 0.1.770 had no Claude after Refresh while Antigravity 2.19.1's picker had Claude, 5.5 too) — magpie asked fetchAvailableModels with only {project}. Antigravity's language server (2.19.1, read from its binary) sends FetchAvailableModelsRequest{project, request_id, entitlement{user_tier}, location}, entitlement being the tier it keeps for the account (SetUserTier, with the plan's name) and the only v1internal request that has one. A Pro account's loadCodeAssist (CLIProxyAPI #6186) has currentTier standard-tier (usesGcpTos), paidTier g1-pro-tier "Google AI Pro", project aicode-consumers; asked with no tier, Google most likely serves it as standard-tier, Code Assist Standard, which has no Claude. Google checks the field: on our free account free-tier/bogus ids are INVALID_ARGUMENT, and standard-tier, g1-pro-tier, g1-ultra-tier and the other paid ids are FAILED_PRECONDITION, so paid ids are known and checked against the account. Ruled out on the free account: the project (none, random, aicode-consumers all the same), daily/prod/sandbox (all list Claude), and magpie's filters (only chat_/tab_ and six fixed ids, none Claude). Now fetchAvailableModels sends entitlement.userTier: the paid tier, then the current tier, skipping free-tier and legacy-tier, and on a refusal tries the next and at last none, as before; a free account sends none, so its request is unchanged. The tiers come from loadCodeAssist, which is now asked even when a project was kept with the sign-in (import, magpie accounts project), which used to skip it and so never learned the tier; if that fails the kept project is used as before. Logged: loadCodeAssist's current and paid tiers (with gcp-tos), project and ineligible tiers with reasons; each refresh's endpoint, User-Agent, project, tiers, entitlement sent, models listed and kept, the ids left out and why (not for chat, completion-only), those Google marks disabled (still listed), and the Claude ids; a tier refused, with Google's error. TestAntigravityProAccountNamesItsTier (Pro fixture: Claude only with g1-pro-tier named), TestAntigravityTierRefusedFallsBack and TestAntigravityTierFreeAndKeptProject fail on the old code (Gemini only) and pass. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried with a real Pro account: whether Google serves Claude to a Pro account only with its tier named is inferred from the client and the fixtures, not seen. 2026-10-04 00:23:05 +08:00
yetone 8b23ed03c6 antigravity: models as Antigravity lists them — its picker's order, its context, output and images (0000FF on Discord: Antigravity offers Claude Opus 5.5 and Sonnet 5.5, magpie still shows 4.6) — magpie already lists Antigravity's models live from fetchAvailableModels, with no Claude allowlist; the backend doesn't offer 5.5 yet: the signed-in account's list today (prod and daily, hub 2.19.1) has only claude-opus-4-6-thinking and claude-sonnet-4-6, generateContent answers 404 for claude-opus-5-5, claude-sonnet-5-5 and their -thinking ids, CLIProxyAPI's antigravity registry and Antigravity-Manager have no 5.5, and the AI Developers Forum still asks Google to add it (2026-09-30); agy 1.2.16 names claude-opus-5-5@default only for the enterprise Vertex gateway. So no ids are guessed in; what changes is how a model Google adds arrives: the list was sorted by id (Opus 4.6 before any 5.5) and took context from magpie's catalog by id (Anthropic's 1M, where Antigravity gives Claude 250k) and images from "not gpt-oss". Now models() follows agentModelSorts (the picker's order, newest first; models not in it after, by id), and each model keeps the maxTokens, maxOutputTokens and supportsImages Antigravity gives it; quota windows keep their order. TestAntigravityModelsAsItListsThem fails on the old code (id order, no limits, a text-only model said to see). Against the real account in a temp HOME: Gemini 3.8/3.7/3.6 Flash first, Claude at 250000/64000, GPT-OSS 131072 without images. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but TestProvidersAnswerWhileListsComeIn and TestUserPath, timing tests that pass alone. 2026-10-03 15:45:01 +08:00
yetone 5df609e525 usage: an Antigravity account shows each group of models' 5-hour and weekly allowance, one row a group (a user on Discord: 这里显示5h 和一周剩余比较好吧,现在是只显示5h,这3个模型都是一样的,没必要分开…多加个7day 条就好) — fetchAvailableModels gives each model only its 5-hour figure, the same for every model drawing on one quota, so the Usage page, the panel and the account rows showed a figure a family (Gemini, Claude, GPT-OSS) and no week. Antigravity's retrieveUserQuotaSummary reports the quota a group ("Gemini Models"; "Claude and GPT models", Claude and GPT-OSS sharing one), each with a 5h and a weekly bucket; magpie now reads it beside the models' (best-effort: without it the windows are as before) and adds each group's windows, named "5 hours" and "7 days" with their pool (Gemini, Claude & GPT), each model's window naming its pool. The Usage page shows Gemini · 5 hours, Gemini · 7 days, Claude & GPT · 5 hours, Claude & GPT · 7 days, the pool's models in each tooltip; the panel four rings (Gemini 5h/7d, Claude 5h/7d); the account rows each pool with its 5h and 7d meters; the TUI the pools' windows in place of the models'. "Every model" lists the models' own windows. The pools' windows are aside for routing, which reads the models' as before; the tray's text is unchanged. TestAntigravityQuotaPools and quota-pools.test.cjs (Chromium, WebKit; en, zh) fail without the change; quota-families, click-scroll, old-webkit, tray-usages, panel-usage pass. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-02 07:03:17 +08:00
Charan Rathore b643231fc7 edit, provider: stop inline comments leaking into dotenv values (#439)
* edit,provider: stop reading inline comments as part of dotenv values

* provider: read Google env values through edit.GetEnvFile
2026-10-02 00:57:41 +08:00
yetone 9bf6d43527 claude: magpie no longer asks Anthropic for a Claude account's usage, and adding a Claude account warns of a ban (the user: 不要伪造任何的 Claude 请求,能否通过 claude cli 获取 / 我害怕被封; 添加账号时要像其他的 Subscription Provider 一样显示风险提示) — the usage was read by magpie itself calling Anthropic's /api/oauth/usage with the account's token, on a timer, for every saved account, and Claude's usage-limit resets (cedar_ember) were listed, spent and auto-spent the same way. Now the usage is what Claude Code's own /usage prints (claude -p /usage, a command Claude Code answers itself without asking a model), run only when Usage is opened or Refresh pressed (GUI, magpie quota, accounts, TUI), for the account Claude Code is signed in to, at most once in 30s; a saved account shows only what Claude Code reported while using it, or the last reading kept. The Claude resets, Auto-use and their settings are gone (Codex's stay). Session jsonl files hold no usage figures, so they aren't read. Starting a Claude sign-in or import (GUI and CLI) first says Anthropic may suspend or ban the account and that it is at the user's own risk. TestClaudeWindowsAsked, TestParseClaudeUsage, TestClaudeUsageRunsClaudeCode, claude-usage-asked.test.cjs and claude-risk.test.cjs fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; routing-auto-reset, codex-auto-reset, quota-families, tray-usages, click-scroll, old-webkit, plugin-signin, usage-alert, usage-ledger pass. 2026-10-01 12:38:25 +08:00
yetone 31b6257c7e usage: an Antigravity account shows a meter for each model family, not for each model (01huadalang on Discord: 谷歌的反重力如果登录多个账号显示得很丑…low mid 和 high 都要显示,这样好臃肿) — Antigravity gives a quota for each model it lists (13 in its recorded list), and the Usage page drew them all, 9–13 meters an account, while the panel and the account rows showed the first 3 or 2 by id. Each window now carries its family (Gemini, Claude, GPT-OSS…), and the Usage page, the panel and the account rows show one meter a family, the most used of its models (the soonest reset on a tie); its tooltip lists every model, and "Every model" swaps the account's meters in place without moving the page. Windows, routing and the model filter are unchanged; cards without families look as before. TestAntigravityQuotaFamilies and quota-families.test.cjs (Chromium, WebKit, en/zh) fail without the change; click-scroll, old-webkit, tray-usages, claude-resets, codex-auto-reset pass. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-01 06:19:25 +08:00
yetone c47b22ee27 agents: "Hide all" in an agent's model list keeps its line, and an uninstalled Gemini CLI goes from the Agents page (#356, #230) — the line under an agent ("Showing 0 / N models") came only when a picker still listed one of magpie's models, so hiding them all took away the one way back; it now stays while any is hidden. Gemini CLI was taken as present from what it leaves in ~/.gemini (settings.json, .env, installation_id…), which stays after it is uninstalled, so its row stayed, offering to set up a CLI that can't run; it is now its gemini binary. TestAgentModelLineAllHidden and TestGeminiNotAntigravity fail without the change; agent-models-all-hidden.test.cjs (Chromium, WebKit, en/zh) added. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./internal/agent ./internal/gui ./internal/library ./internal/provider pass; agent-models, click-scroll, old-webkit pass. 2026-10-01 01:03:57 +08:00
yetone e92994b37a agents, library: Antigravity alone no longer shows Gemini CLI (#330), and turning an agent off on a skill or MCP server says it was removed (#332) — Gemini CLI was found from ~/.gemini existing, where Antigravity keeps its own folders (antigravity, antigravity-cli, config) and reads GEMINI.md; it now takes only what Gemini CLI writes there (settings.json, .env, google_accounts.json, installation_id, trustedFolders.json, mcp-oauth-tokens.json, an oauth_creds.json its own OAuth client minted, as #143) or a gemini on PATH. The Library's agent chips said 「已写入 X」 on the way off too; they now say 「已从 X 中移除」 (or N agents, or N updated for a mix). TestGeminiNotAntigravity and library-toggle-status.test.cjs (Chromium, WebKit, en/zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; library-items, shared-skills, click-scroll, old-webkit pass. 2026-09-30 21:57:06 +08:00
yetone 6546033109 kiro: removing kiro-cli's or the Kiro IDE's own sign-in hides it in magpie, and it shows again when Kiro signs in anew (Discord 碳碳双键: 本机没安装 kiro,但旧的 Kiro 数据还在,magpie 列出一个"Kiro account"(登录已失效,请重新添加此账号),添加新账号并设为首位后,旧的数据无法移除) — magpie reads Kiro's own sign-in from kiro-cli's database or ~/.aws/sso/cache and lists it among the accounts it signed in; Remove on it said "that is kiro-cli's or the Kiro IDE's own sign-in; run kiro-cli logout or sign out in the IDE", which with neither installed left a dead account there for good. The same refusal was shared by every agent whose own sign-in magpie only reads (forgetSideLogin: Kiro, Devin, Grok, Copilot, ZCode, WorkBuddy and WorkBuddy AI, Command Code, Gemini CLI, Antigravity). Now Remove on the agent's own sign-in hides it: logins.json's entry for it keeps a Hidden mark, and it is left out of the account list and so of the gateway's tries (the first and the ones behind it both come from that list); the agent's files are never deleted or written. It shows again when that sign-in changes: for Kiro, by a mark that is a digest of where the sign-in is (kiro-cli's row or the IDE's file) and its refresh token (never the token itself), so a new kiro-cli login or IDE sign-in, to any account, brings it back; for the others, which have no such mark, when it is another account. Removing it while it is first is allowed now, the next account being put first (saved, so it stays first when the own one comes back); removed when it was the only one, the agent has no account left. One of magpie's own accounts is removed with its home as before, and still can't be while it is first. The error and its per-agent sign-out hints are gone. Logins carry own, and the accounts list shows Remove on the agent's own sign-in also while it is first, its title "magpie stops showing and using Kiro's own sign-in; its files are left as they are, and it shows again when Kiro signs in anew" (magpie 不再显示和使用 Kiro 自己的登录;它的文件保持原样,Kiro 重新登录后会再次出现). Tested with a new internal/provider/side_logins_hide_test.go in a sandbox HOME: an expired kiro-cli sign-in ("Kiro account") behind a Google one magpie signed in is removed, stays gone across reads, isn't the account used nor among AlsoOn, kiro-cli's database byte-for-byte and mtime as it was, the refresh token nowhere in magpie's files; a new kiro-cli sign-in brings it back behind the one first; put first and removed, the next is first; one of magpie's removed takes its home and leaves the other's; the only account removed leaves Kiro with none; Grok's CLI sign-in hidden with auth.json untouched, back once it is another account. The agents' tests that expected the refusal (Command Code, Copilot, Devin, Grok, WorkBuddy, ZCode) no longer do. A new internal/gui/tests/own-signin-remove.test.cjs in Chromium and WebKit, en and zh: kiro-cli's sign-in behind another and alone first both have Remove with that title and post login/forget, magpie's first account has none. go build -tags nogui (and GOOS=linux, GOOS=windows), go test -tags nogui ./... and the whole GUI suite (138) pass. Not tried with a real Kiro, kiro-cli or the Kiro IDE. 2026-09-29 23:52:33 +08:00
yetone 6b546aa81d gemini: 3.8 Flash asked of an account it isn't rolled out to goes as that account's Flash (蒙面人 on Discord: 502 错误 for gemini/gemini-3.8-flash) — the list magpie falls back on has 3.8 Flash and 3.5 Flash Lite, and a model picked from it went to Code Assist under that id whatever the account's experiments said; now, as Gemini CLI would, 3.8 Flash goes as gemini-3-flash and 3.5 Flash Lite as gemini-3.1-flash-lite where they aren't rolled out. Tested against a fake Code Assist 2026-09-29 11:04:46 +08:00
yetone 7047716de6 gemini: a Gemini CLI account lists the models Gemini CLI 0.61 offers it, Gemini 3.8 Flash among them (蒙面人 on Discord: 请问,这个不显示 Gemini 3.8 吗??) — magpie's list was Gemini CLI's of some versions ago, and the models it fetched were the account's quota buckets, which name models by Code Assist's ids (gemini-3-flash) and never 3.8 Flash. Now, as the CLI does, magpie asks Code Assist which experiments the account is in (listExperiments, at most hourly) and offers what the CLI's /model would: 3.1 Pro Preview or 3 Pro Preview, 3 Flash Preview (previews only with quota for one), 3.8 Flash where Google has rolled it out and 3.5 Flash where not, 3.5 or 3.1 Flash Lite likewise, 2.5 Pro and 2.5 Flash Lite; a request goes out under the id the CLI sends (3.5 Flash as gemini-3-flash, or as gemini-3.8-flash once rolled out), and quota buckets are shown under the models listed. The list magpie falls back on has 3.8 Flash, 3.5 Flash and 3.5 Flash Lite, and no longer the retired 3.1 Flash Lite Preview; magpie says it is Gemini CLI 0.61.0. Tested against a fake Code Assist with the experiments off, rolled out, and without Pro or preview access 2026-09-29 10:43:23 +08:00
yetone 356549710b subscription: Antigravity accounts can be imported from a JSON file (莫: https://github.com/jlcodes99/vscode-antigravity-cockpit 这个开源的里面有 你可以看看) — beside Add account (and as "Import instead…" on the risk note) the Antigravity card takes files or pasted text exported by Antigravity Cockpit (a JSON array of {email, refresh_token}, or refresh tokens one a line), Antigravity Manager (the same array, {accounts:[…]}, or an account file with token{refresh_token, email, project_id}) and CLIProxyAPI (an antigravity auth file, type/email/refresh_token/project_id; another type's is refused). All three sign in with the Antigravity app's own OAuth client, as magpie does, so their refresh tokens are good here. Each account is checked as signing in does: the token refreshed at Google, the email read from userinfo (the file's if that's refused), the project and plan from loadCodeAssist, then kept in logins.json like a signed-in account. A token magpie already has is not sent again (exists); a known email with a new token replaces the old (updated); duplicates in the file, entries with no token and tokens Google refuses are reported per account, Google's bare "Bad Request" explained. POST /api/signin/import; tokens are never logged, shown or returned, and the paste box is masked. Tested against an httptest token/userinfo/Code Assist server in a sandbox HOME 2026-09-29 00:52:09 +08:00
yetone bb7ce5ec31 provider: an account signed in from magpie is listed even when the agent's own sign-in of it can't be read (tinysnake: workbuddy 登录以后,对应的 provider 并未出现) — once WorkBuddy's own account had been seen, logins.json remembered it as WorkBuddy's own (no secrets). With WorkBuddy then signed out, or its tokens kept encrypted ({"$wbEncrypted":…}), that entry is hidden, and signing the same account in from magpie was taken for a duplicate of it and dropped (addSideLogin): the sign-in said done, the toast showed, and no WorkBuddy provider appeared. addSideLogin is now told who the agent is signed in to right now; only when that is the same account is the new sign-in a duplicate, otherwise the remembered entry takes the new sign-in, and sideLogins doesn't add the own account twice once it's back. Copilot, Grok, ZCode and Gemini had the same flaw through the same code and are fixed with it. The window no longer says "added" when a finished sign-in isn't in the Providers list: it says so as an error. Tested with a fake WorkBuddy sign-in server in a sandbox HOME (own account remembered, then signed out or encrypted, then signed in from magpie: listed and signing with the new token; WorkBuddy readable again: still one account); not tested against the real WorkBuddy, and whether the reporter's WorkBuddy was signed out or encrypted isn't known 2026-09-28 21:38:02 +08:00
yetone 10d4e98e19 provider: ~/.gemini/oauth_creds.json is Gemini CLI's only when Gemini CLI's OAuth client minted it (#143) — a sign-in whose ID token names another client (Antigravity's) can't be refreshed as Gemini CLI's and is no longer listed as its account; agy keeps its sign-in in the system keyring, not there, so a personal account Google turns away from Gemini CLI is now told to add itself under Antigravity in magpie 2026-09-28 18:01:49 +08:00
yetone aedf23abc5 provider: a relay given without its /v1 — one that lists its models at base/v1/models but not at the base — has /v1 added to its chat and responses bases when its models are fetched, since the gateway sends chat to the base as written and its requests 404'd while its models showed; and an Antigravity account Google gave no project says so plainly (with Google's reason, when it gives one) instead of "Usage unavailable" alone 2026-09-25 16:51:26 +08:00
yetone 637b2458ee provider + gateway: Google sign-ins — Gemini CLI's and Antigravity's — are subscriptions of magpie's, so any agent can use their models (#4); Gemini CLI's own login in ~/.gemini is read as it is, or an account is signed in from magpie with Google's OAuth, its token refreshed in memory, and each request goes to Code Assist wrapped as the app wraps it, with the project Code Assist set the account up with; Google now serves Gemini CLI's sign-in only to Code Assist Standard and Enterprise, which need a Cloud project, named with magpie accounts project or GOOGLE_CLOUD_PROJECT in ~/.gemini/.env and said so where the account is shown; Google may suspend an Antigravity account used outside Antigravity, so magpie says that and asks before adding one 2026-09-25 15:53:33 +08:00