YujunT46308 on X: wired through magpie, Antigravity 2.29.0 showed a
200K window for every model, and after a restart it lost /boost,
/teamwork, /plugin and /generative_ui.
The window. The app's backend (Resources/bin/language_server) resolves
models from models.list, then models.listSource (a remote catalog,
fetched with the gateway key), then <url>/v1/models, then its built-in
catalog. From /v1/models it reads the id alone; a model its catalog
doesn't know gets its family's defaults, maxTokens 200000. No field of
the OpenAI list (context_window, context_length, max_input_tokens) is
read. magpie now points models.listSource at
<gateway>/v1/models?format=antigravity, which answers {"list": [...]}
in the app's own fields (modelId, displayName, maxTokens,
maxOutputTokens, supportsImages, supportsThinking) for the models the
key may use. A field magpie doesn't know is left out. The user's own
listSource is stashed with their gateway and put back; Sync adds the
catalog to a file wired before, at the gateway's current address.
The picker now shows magpie's names, so NoNames is off for it.
The Google features. Not fixable on this route: on a gateway the app
uses no Google sign-in and its backend calls neither cloud_code_endpoint
nor api_server_url (headless run below), and Google's docs say a gateway
and a Google Account can't be used at once. The experiments and
commands Google's servers turn on for a signed-in account are off while
it is on magpie. No key in settings.json keeps both. The notice shown on
connecting (GUI toast, CLI) now names what is lost and that turning it
off gives it back, in en, zh, zh-TW, ja, de.
Run (mote, at this head unless said):
- go test -tags nogui ./internal/agent ./internal/gateway -run Antigravity:
ok. Broken by hand: the listSource writes taken out ->
TestAntigravityGateway, TestAntigravityCatalogSource,
TestAntigravitySyncAddsCatalog red; the ?format branch taken out ->
TestAntigravityCatalog red.
- gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., go build, GOOS=linux go build -tags nogui,
GOOS=windows go build: ok.
- GUI (Chromium and WebKit): i18n-keys, i18n-en-no-cjk,
agent-notice-lang, about-notices, gui-de, gui-ja, gui-zh-tw,
name-suffix-no-names at the pre-rebase tree (only i18n.js differs in
the GUI): all pass except i18n-keys "a plugin's words are its own",
red the same on origin/main 18a9a2d88 (#5332, #5426, #5482).
- Real: the real Antigravity 2.29.0 language_server, headless, in a
sandbox HOME, against magpie built from this tree (sandbox HOME, port
3600) with a fake OpenAI vendor whose model has a 1048576 window.
`magpie antigravity magpie/up/big-ctx` wrote listSource; the backend
logged "Resolving models from Tier 2 (Remote catalog listSource)",
GetAvailableModels gave maxTokens 1048576, maxOutputTokens 65536 and
the label "big-ctx · up". A streamed chat with the app's key and UA
went through magpie. Turning it off left the file as it was ({}).
- Full go test -tags nogui -timeout 45m ./...: queued behind mote's
suite lock at push time; its result is recorded after the push.
Not tried: the Antigravity GUI app itself (only its backend, headless),
and a chat sent from the app's own composer.
49 lines
1.7 KiB
Go
49 lines
1.7 KiB
Go
package gateway
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/yetone/magpie/internal/provider"
|
|
)
|
|
|
|
// AntigravityFormat is the /v1/models format Antigravity's app reads as its
|
|
// remote model catalog (its settings.json's models.listSource).
|
|
const AntigravityFormat = "antigravity"
|
|
|
|
// antigravityModels answers /v1/models?format=antigravity: the models the
|
|
// key asking may use, as Antigravity's app (2.29.0) reads a remote catalog,
|
|
// {"list": [{"modelId", "displayName", "maxTokens", "maxOutputTokens",
|
|
// "supportsImages", "supportsThinking"}]}, fetched with the gateway key as
|
|
// a bearer token.
|
|
//
|
|
// Its gateway discovery (<url>/v1/models) reads a model's id alone and
|
|
// gives one its built-in catalog doesn't know the defaults of its family,
|
|
// a window of 200K tokens whatever the model's (YujunT46308 on X): no
|
|
// field of the OpenAI list is read for it, context_window and
|
|
// context_length included. Its catalog (models.listSource, or models.list
|
|
// inline) is read first and takes a window per model as maxTokens, and a
|
|
// name as displayName, which its picker shows. A field magpie doesn't know
|
|
// is left out, and the app's family default stands for it.
|
|
func antigravityModels(w http.ResponseWriter, r *http.Request) {
|
|
shown := catalogFor(r)
|
|
labels := provider.Labels(shown)
|
|
list := make([]map[string]any, 0, len(shown))
|
|
for i, e := range shown {
|
|
m := map[string]any{"modelId": e.ID, "displayName": labels[i]}
|
|
if e.Context > 0 {
|
|
m["maxTokens"] = e.Context
|
|
}
|
|
if out := e.PublishedOutput(); out > 0 {
|
|
m["maxOutputTokens"] = out
|
|
}
|
|
if e.Images {
|
|
m["supportsImages"] = true
|
|
}
|
|
if e.Thinks() {
|
|
m["supportsThinking"] = true
|
|
}
|
|
list = append(list, m)
|
|
}
|
|
writeJSON(w, 200, map[string]any{"list": list})
|
|
}
|